v3.4.0 (#139) #379
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
| # CI checks and validation workflow | |
| name: checks | |
| env: | |
| CICD_INTERMEDIATES_DIR: "_cicd-intermediates" | |
| on: | |
| workflow_dispatch: | |
| pull_request: | |
| push: | |
| branches: | |
| - main | |
| jobs: | |
| all-checks: | |
| # If we don't do this, the job will be skipped if the matrix job fails. | |
| if: always() | |
| name: all-checks | |
| runs-on: ubuntu-latest | |
| needs: | |
| - crate_metadata | |
| - lint | |
| - license_checks | |
| - cargo-audit | |
| steps: | |
| - run: jq --exit-status 'all(.result == "success")' <<< '${{ toJson(needs) }}' | |
| crate_metadata: | |
| name: Extract crate metadata | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Extract crate information | |
| id: crate_metadata | |
| run: | | |
| cargo metadata --no-deps --format-version 1 | jq -r '"name=" + .packages[0].name' | tee -a $GITHUB_OUTPUT | |
| cargo metadata --no-deps --format-version 1 | jq -r '"version=" + .packages[0].version' | tee -a $GITHUB_OUTPUT | |
| cargo metadata --no-deps --format-version 1 | jq -r '"maintainer=" + .packages[0].authors[0]' | tee -a $GITHUB_OUTPUT | |
| cargo metadata --no-deps --format-version 1 | jq -r '"homepage=" + .packages[0].homepage' | tee -a $GITHUB_OUTPUT | |
| outputs: | |
| name: ${{ steps.crate_metadata.outputs.name }} | |
| version: ${{ steps.crate_metadata.outputs.version }} | |
| maintainer: ${{ steps.crate_metadata.outputs.maintainer }} | |
| homepage: ${{ steps.crate_metadata.outputs.homepage }} | |
| lint: | |
| name: Lint | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout source code | |
| uses: actions/checkout@v4 | |
| - name: Install Rust toolchain | |
| uses: dtolnay/rust-toolchain@master | |
| with: | |
| toolchain: nightly | |
| components: clippy, rustc-codegen-cranelift-preview, rustfmt | |
| - name: Run clippy | |
| run: cargo clippy --locked --all-targets -- -D warnings | |
| - name: Check formatting | |
| run: cargo fmt --check | |
| license_checks: | |
| name: License checks | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| submodules: true | |
| - run: chmod +x scripts/license-checks.sh | |
| - run: ./scripts/license-checks.sh | |
| cargo-audit: | |
| name: cargo audit | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout source code | |
| uses: actions/checkout@v4 | |
| - name: Install Rust toolchain | |
| uses: dtolnay/rust-toolchain@master | |
| with: | |
| toolchain: nightly | |
| components: rustc-codegen-cranelift-preview | |
| - name: Install `cargo-audit` | |
| uses: taiki-e/install-action@cargo-audit | |
| - run: cargo audit |