sparse mode #66
Workflow file for this run
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: | |
| workflow_dispatch: | |
| jobs: | |
| clippy: | |
| name: Clippy | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Install toolchain | |
| uses: dtolnay/rust-toolchain@nightly | |
| with: | |
| components: clippy | |
| - name: Rust cache | |
| uses: Swatinem/rust-cache@v2 | |
| - name: Install sarif-fmt & clippy-sarif | |
| uses: taiki-e/install-action@v2 | |
| with: | |
| tool: sarif-fmt,clippy-sarif | |
| - name: Run clippy | |
| run: cargo clippy --message-format=json | clippy-sarif | tee results.sarif | sarif-fmt | |
| - name: Upload SARIF file | |
| uses: github/codeql-action/upload-sarif@v3 | |
| with: | |
| sarif_file: results.sarif | |
| rustfmt: | |
| name: Format | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Install toolchain | |
| uses: dtolnay/rust-toolchain@nightly | |
| with: | |
| components: rustfmt | |
| - name: Rust cache | |
| uses: Swatinem/rust-cache@v2 | |
| - name: Run cargo fmt | |
| run: cargo fmt --all -- --check | |
| miri: | |
| name: Miri [${{ matrix.endianness }}] | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| endianness: | |
| - littleendian | |
| - bigendian | |
| include: | |
| - endianness: littleendian | |
| target: x86_64-unknown-linux-gnu | |
| - endianness: bigendian | |
| target: s390x-unknown-linux-gnu | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Install toolchain | |
| uses: dtolnay/rust-toolchain@nightly | |
| with: | |
| components: miri | |
| targets: ${{ matrix.target }} | |
| - name: Rust cache | |
| uses: Swatinem/rust-cache@v2 | |
| - name: Install sarif-fmt, miri-sarif & nextest | |
| uses: taiki-e/install-action@v2 | |
| with: | |
| tool: sarif-fmt,miri-sarif,nextest | |
| - name: Run miri | |
| shell: bash # this is needed for bash to run with -o pipefail | |
| run: | | |
| MIRIFLAGS="--error-format=json" cargo miri nextest run --target ${{ matrix.target }} -j num-cpus \ | |
| --success-output immediate --failure-output immediate --final-status-level all --no-fail-fast 2>&1 \ | |
| | tee miri.log | |
| - name: Convert miri log to SARIF | |
| if: always() | |
| run: | | |
| miri-sarif -i miri.log \ | |
| | jq '(.runs[] | select(.tool.driver.name == "miri")).tool.driver.name |= "miri [${{ matrix.endianness }}]"' \ | |
| | tee results.sarif | sarif-fmt | |
| - name: Upload SARIF file | |
| uses: github/codeql-action/upload-sarif@v3 | |
| if: always() | |
| with: | |
| sarif_file: results.sarif | |
| tests: | |
| name: Tests | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Install toolchain | |
| uses: dtolnay/rust-toolchain@nightly | |
| - name: Rust cache | |
| uses: Swatinem/rust-cache@v2 | |
| with: | |
| cache-on-failure: true | |
| - name: Run tests | |
| run: | | |
| cargo test --no-fail-fast | |
| cargo test --no-fail-fast --no-default-features | |
| msrv: | |
| name: MSRV | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Rust cache | |
| uses: Swatinem/rust-cache@v2 | |
| - name: Install cargo-msrv | |
| uses: taiki-e/install-action@v2 | |
| with: | |
| tool: cargo-msrv | |
| - name: Check MSRV | |
| run: cargo msrv verify |