Repository navigation
chore(CI): tigger CI on merge_group events (#18)
#30
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: Rust | ||
| on: | ||
| push: | ||
| branches: [ "main" ] | ||
| pull_request: | ||
| branches: [ "main" ] | ||
| merge_group: [checks_requested] | ||
| env: | ||
| CARGO_TERM_COLOR: always | ||
| # https://github.com/xd009642/tarpaulin | ||
| TARPAULIN_VERSION: 0.35.1 | ||
| # https://github.com/est31/cargo-udeps | ||
| UDEPS_VERSION: 0.1.60 | ||
| # https://github.com/rustsec/rustsec | ||
| AUDIT_VERSION: 0.22.1 | ||
| concurrency: | ||
| group: ${{ github.workflow }}-${{ github.ref }} | ||
| cancel-in-progress: true | ||
| jobs: | ||
| linter: | ||
| runs-on: ubuntu-latest | ||
| name: Cargo fmt and clippy | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - name: Check formatting | ||
| run: cargo fmt --all -- --check | ||
| tests: | ||
| runs-on: ubuntu-latest | ||
| name: Cargo test and tarpaulin | ||
| needs: linter | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - name: Install cargo-tarpaulin@${{ env.TARPAULIN_VERSION }} | ||
| run: cargo install cargo-tarpaulin@${{ env.TARPAULIN_VERSION }} --locked | ||
| - name: Build | ||
| run: cargo build --verbose | ||
| - name: Run tests | ||
| run: cargo test --verbose | ||
| - name: Run tarpaulin | ||
| run: cargo tarpaulin --verbose | ||
| audit: | ||
| runs-on: ubuntu-latest | ||
| name: Cargo udeps and audit | ||
| needs: linter | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - name: Install cargo-udeps | ||
| run: cargo install cargo-udeps@${{ env.UDEPS_VERSION }} --locked | ||
| - name: Install cargo-audit | ||
| run: cargo install cargo-audit@${{ env.AUDIT_VERSION }} --locked | ||
| - name: Run cargo udeps | ||
| run: cargo +nightly udeps --verbose | ||
| - name: Run cargo audit | ||
| run: cargo audit | ||