Call cycle_fn for every iteration (#1021)
#2984
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@v4 | |
| - name: Setup Rust toolchain | |
| uses: dtolnay/rust-toolchain@master | |
| id: rust-toolchain | |
| with: | |
| toolchain: ${{ matrix.rust }} | |
| components: rustfmt, clippy | |
| - uses: taiki-e/install-action@nextest | |
| - uses: actions/cache@v4 | |
| with: | |
| path: | | |
| ~/.cargo/bin/ | |
| ~/.cargo/registry/index/ | |
| ~/.cargo/registry/cache/ | |
| ~/.cargo/git/db/ | |
| target/ | |
| key: ${{ runner.os }}-cargo-${{ steps.rust-toolchain.outputs.cachekey }}-${{ hashFiles('**/Cargo.toml') }} | |
| restore-keys: | | |
| ${{ runner.os }}-cargo-${{ steps.rust-toolchain.outputs.cachekey }}- | |
| ${{ runner.os }}-cargo- | |
| - 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: | |
| name: Miri | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Install Miri | |
| uses: dtolnay/rust-toolchain@miri | |
| id: rust-toolchain | |
| - uses: taiki-e/install-action@nextest | |
| - uses: actions/cache@v4 | |
| with: | |
| path: | | |
| ~/.cargo/bin/ | |
| ~/.cargo/registry/index/ | |
| ~/.cargo/registry/cache/ | |
| ~/.cargo/git/db/ | |
| target/ | |
| key: ${{ runner.os }}-cargo-${{ steps.rust-toolchain.outputs.cachekey }}-miri-${{ hashFiles('**/Cargo.toml') }} | |
| restore-keys: | | |
| ${{ runner.os }}-cargo-${{ steps.rust-toolchain.outputs.cachekey }}-miri- | |
| ${{ runner.os }}-cargo-${{ steps.rust-toolchain.outputs.cachekey }}- | |
| ${{ runner.os }}-cargo- | |
| - name: Setup Miri | |
| run: cargo miri setup | |
| - name: Test with Miri | |
| run: cargo miri nextest run --no-fail-fast --tests | |
| env: | |
| MIRIFLAGS: -Zmiri-disable-isolation -Zmiri-retag-fields | |
| - name: Run examples with Miri | |
| run: cargo miri run --example calc | |
| shuttle: | |
| name: Shuttle | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Setup Rust toolchain | |
| uses: dtolnay/rust-toolchain@master | |
| id: rust-toolchain | |
| with: | |
| toolchain: stable | |
| - uses: taiki-e/install-action@nextest | |
| - uses: actions/cache@v4 | |
| with: | |
| path: | | |
| ~/.cargo/bin/ | |
| ~/.cargo/registry/index/ | |
| ~/.cargo/registry/cache/ | |
| ~/.cargo/git/db/ | |
| target/ | |
| key: ${{ runner.os }}-cargo-${{ steps.rust-toolchain.outputs.cachekey }}-${{ hashFiles('**/Cargo.toml') }} | |
| restore-keys: | | |
| ${{ runner.os }}-cargo-${{ steps.rust-toolchain.outputs.cachekey }}- | |
| ${{ runner.os }}-cargo- | |
| - name: Test with Shuttle | |
| run: cargo nextest run --features shuttle --test parallel | |
| benchmarks: | |
| # https://github.com/CodSpeedHQ/action/issues/126 | |
| if: github.event_name != 'merge_group' | |
| name: Benchmarks | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v5 | |
| - name: Setup Rust toolchain | |
| uses: dtolnay/rust-toolchain@master | |
| id: rust-toolchain | |
| with: | |
| toolchain: stable | |
| - name: "Setup codspeed" | |
| uses: taiki-e/install-action@v2 | |
| with: | |
| tool: cargo-codspeed | |
| - uses: actions/cache@v4 | |
| with: | |
| path: | | |
| ~/.cargo/bin/ | |
| ~/.cargo/registry/index/ | |
| ~/.cargo/registry/cache/ | |
| ~/.cargo/git/db/ | |
| target/ | |
| key: ${{ runner.os }}-cargo-${{ steps.rust-toolchain.outputs.cachekey }}-${{ hashFiles('**/Cargo.toml') }} | |
| restore-keys: | | |
| ${{ runner.os }}-cargo-${{ steps.rust-toolchain.outputs.cachekey }}-benchmark | |
| ${{ runner.os }}-cargo-${{ steps.rust-toolchain.outputs.cachekey }} | |
| ${{ runner.os }}-cargo- | |
| - name: "Build benchmarks" | |
| run: cargo codspeed build | |
| - name: "Run benchmarks" | |
| uses: CodSpeedHQ/action@v4 | |
| with: | |
| mode: instrumentation | |
| run: cargo codspeed run | |
| token: ${{ secrets.CODSPEED_TOKEN }} |