Merge pull request #11 from bodo-run/defaults #44
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: CI | |
| on: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| branches: [main] | |
| release: | |
| types: [created] | |
| workflow_dispatch: | |
| inputs: | |
| publish: | |
| type: boolean | |
| default: false | |
| env: | |
| CARGO_TERM_COLOR: always | |
| jobs: | |
| build: | |
| name: Build | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: dtolnay/rust-toolchain@stable | |
| - run: cargo build --all-features | |
| test: | |
| name: Test | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: dtolnay/rust-toolchain@stable | |
| - run: cd examples/basic && cargo build --all-features | |
| - run: cd examples/advanced && cargo build --all-features | |
| - run: cargo test --all-features | |
| - run: cargo run --example basic | |
| - run: cargo run --example advanced | |
| clippy: | |
| name: Clippy | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: dtolnay/rust-toolchain@stable | |
| with: | |
| components: clippy | |
| - run: cargo clippy -- -D warnings | |
| publish-macro: | |
| name: Publish macro to crates.io | |
| needs: [test, clippy] | |
| runs-on: ubuntu-latest | |
| if: github.event_name == 'release' && github.event.action == 'created' || github.event_name == 'workflow_dispatch' && github.event.inputs.publish == 'true' | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: dtolnay/rust-toolchain@stable | |
| - run: cargo publish | |
| env: | |
| CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }} |