Test #3485
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: Test | |
| on: | |
| pull_request: | |
| merge_group: | |
| push: | |
| branches: | |
| - master | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| test: | |
| name: Test | |
| strategy: | |
| matrix: | |
| rust: | |
| - 1.85.0 | |
| - stable | |
| - beta | |
| experimental: | |
| - false | |
| include: | |
| - rust: nightly | |
| experimental: true | |
| continue-on-error: ${{ matrix.experimental }} | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 | |
| - name: Setup Rust toolchain | |
| shell: bash | |
| run: | | |
| if [[ "${{ matrix.rust }}" == "stable" ]]; then | |
| rustup component add rustfmt clippy | |
| else | |
| args=(--component rustfmt --component clippy) | |
| if [[ "${{ matrix.rust }}" == "nightly" ]]; then | |
| args+=(--allow-downgrade) | |
| fi | |
| rustup toolchain install "${{ matrix.rust }}" "${args[@]}" | |
| rustup override set "${{ matrix.rust }}" | |
| fi | |
| rustup show active-toolchain | |
| - uses: Swatinem/rust-cache@c19371144df3bb44fab255c43d04cbc2ab54d1c4 # v2.9.1 | |
| with: | |
| save-if: ${{ github.ref == 'refs/heads/master' }} | |
| - uses: taiki-e/install-action@25435dc8dd3baed7417e0c96d3fe89013a5b2e09 # v2.81.3 | |
| with: | |
| tool: cargo-nextest | |
| - name: Format | |
| run: cargo fmt -- --check | |
| - name: Clippy | |
| run: cargo clippy --workspace --all-targets -- -D warnings | |
| # TODO: Use something like cargo-hack for more robust feature configuration testing. | |
| - name: Clippy / all-features | |
| run: cargo clippy --workspace --all-targets --features persistence -- -D warnings | |
| - name: Test | |
| run: cargo nextest run --workspace --all-targets --features persistence --no-fail-fast | |
| - name: Test Manual Registration / no-default-features | |
| run: cargo nextest run --workspace --tests --no-fail-fast --no-default-features --features macros | |
| - name: Test docs | |
| run: cargo test --workspace --doc | |
| miri_shards: | |
| name: Miri (${{ matrix.partition }}) | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| partition: | |
| - slice:1/4 | |
| - slice:2/4 | |
| - slice:3/4 | |
| - slice:4/4 | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 | |
| - name: Install Miri | |
| uses: dtolnay/rust-toolchain@miri | |
| id: rust-toolchain | |
| - name: Select Miri toolchain | |
| run: rustup override set "${{ steps.rust-toolchain.outputs.name }}" | |
| - uses: Swatinem/rust-cache@c19371144df3bb44fab255c43d04cbc2ab54d1c4 # v2.9.1 | |
| with: | |
| # Matrix shards share a cache key, so only one can reserve it for saving. | |
| save-if: ${{ github.ref == 'refs/heads/master' && matrix.partition == 'slice:1/4' }} | |
| - uses: taiki-e/install-action@25435dc8dd3baed7417e0c96d3fe89013a5b2e09 # v2.81.3 | |
| with: | |
| tool: cargo-nextest | |
| - name: Setup Miri | |
| run: cargo miri setup | |
| - name: Test with Miri | |
| run: cargo miri nextest run --no-fail-fast --tests --partition ${{ matrix.partition }} | |
| env: | |
| MIRIFLAGS: -Zmiri-disable-isolation | |
| - name: Run examples with Miri | |
| if: matrix.partition == 'slice:1/4' | |
| run: cargo miri run --example calc | |
| miri: | |
| name: Miri | |
| if: always() | |
| needs: miri_shards | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Check Miri shards | |
| run: test "${{ needs.miri_shards.result }}" = success | |
| shuttle: | |
| name: Shuttle | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 | |
| - name: Setup Rust toolchain | |
| run: rustup show | |
| - uses: Swatinem/rust-cache@c19371144df3bb44fab255c43d04cbc2ab54d1c4 # v2.9.1 | |
| with: | |
| save-if: ${{ github.ref == 'refs/heads/master' }} | |
| - uses: taiki-e/install-action@25435dc8dd3baed7417e0c96d3fe89013a5b2e09 # v2.81.3 | |
| with: | |
| tool: cargo-nextest | |
| - name: Test with Shuttle | |
| run: cargo nextest run --features shuttle --test parallel | |
| benchmarks: | |
| # https://github.com/CodSpeedHQ/action/issues/126 | |
| if: github.repository == 'salsa-rs/salsa' &&github.event_name != 'merge_group' | |
| name: Benchmarks | |
| runs-on: codspeed-macro | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 | |
| - name: Setup Rust toolchain | |
| run: rustup show | |
| - uses: Swatinem/rust-cache@c19371144df3bb44fab255c43d04cbc2ab54d1c4 # v2.9.1 | |
| with: | |
| save-if: ${{ github.ref == 'refs/heads/master' }} | |
| - name: "Setup codspeed" | |
| uses: taiki-e/install-action@25435dc8dd3baed7417e0c96d3fe89013a5b2e09 # v2.81.3 | |
| with: | |
| tool: cargo-codspeed | |
| - name: "Build benchmarks" | |
| run: cargo codspeed build -m simulation -m memory | |
| - name: "Run benchmarks" | |
| uses: CodSpeedHQ/action@9d332c4d90b43981c3e55ae8e38e68709996240f # v4.17.0 | |
| with: | |
| mode: "simulation,memory" | |
| run: cargo codspeed run | |
| token: ${{ secrets.CODSPEED_TOKEN }} |