update MSRV to 1.83.0 #1328
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
| on: | |
| pull_request: {} | |
| push: | |
| branches: main | |
| name: Continuous integration | |
| permissions: | |
| contents: read | |
| jobs: | |
| lint: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| RUST: | |
| - nightly | |
| steps: | |
| - uses: actions/checkout@v5.0.0 | |
| with: | |
| persist-credentials: false | |
| - uses: dtolnay/rust-toolchain@e97e2d8cc328f1b50210efc529dca0028893a2d9 | |
| with: | |
| toolchain: ${{ matrix.RUST }} | |
| components: rustfmt, clippy | |
| - uses: actions/cache@v4.3.0 | |
| with: | |
| path: | | |
| ~/.cargo/bin/ | |
| ~/.cargo/registry/index/ | |
| ~/.cargo/registry/cache/ | |
| ~/.cargo/git/db/ | |
| target/ | |
| key: ${{ runner.os }}-${{ matrix.RUST }}-cargo-2-${{ hashFiles('**/Cargo.toml') }} | |
| - run: cargo fmt --all -- --check | |
| - run: cargo clippy --workspace --all-targets -- -D warnings | |
| - run: cargo clippy --workspace --all-targets --all-features -- -D warnings | |
| ci: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| RUST: | |
| # MSRV | |
| - VERSION: "1.83.0" | |
| FLAGS: "" | |
| - VERSION: stable | |
| FLAGS: "" | |
| - VERSION: stable | |
| FLAGS: "--no-default-features --features std" | |
| - VERSION: stable | |
| FLAGS: "--no-default-features" | |
| SKIP_TESTS: true | |
| - VERSION: beta | |
| FLAGS: "" | |
| - VERSION: beta | |
| FLAGS: "--no-default-features --features std" | |
| - VERSION: nightly | |
| FLAGS: "" | |
| - VERSION: nightly | |
| FLAGS: "--no-default-features --features std" | |
| - VERSION: nightly | |
| FLAGS: "-Z direct-minimal-versions" | |
| steps: | |
| - uses: actions/checkout@v5.0.0 | |
| with: | |
| persist-credentials: false | |
| - uses: dtolnay/rust-toolchain@e97e2d8cc328f1b50210efc529dca0028893a2d9 | |
| with: | |
| toolchain: ${{ matrix.RUST.VERSION }} | |
| - uses: actions/cache@v4.3.0 | |
| with: | |
| path: | | |
| ~/.cargo/bin/ | |
| ~/.cargo/git/db/ | |
| target/ | |
| key: ${{ runner.os }}-${{ matrix.RUST.VERSION }}-cargo-2-${{ hashFiles('**/Cargo.toml') }} | |
| - run: | | |
| cargo generate-lockfile | |
| if: matrix.RUST.VERSION == '1.83.0' | |
| - run: cargo check --workspace --tests ${{ matrix.RUST.FLAGS }} | |
| - run: cargo test --workspace ${{ matrix.RUST.FLAGS }} | |
| if: "${{ !matrix.RUST.SKIP_TESTS }}" | |
| coverage: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v5.0.0 | |
| with: | |
| persist-credentials: false | |
| - uses: dtolnay/rust-toolchain@e97e2d8cc328f1b50210efc529dca0028893a2d9 | |
| with: | |
| toolchain: "1.83" | |
| components: llvm-tools-preview | |
| - run: sudo apt update && sudo apt-get install -y lcov | |
| - uses: actions/cache@v4.3.0 | |
| id: cargo-cache | |
| with: | |
| path: target/ | |
| key: ${{ runner.os }}-cargo-5-${{ hashFiles('**/Cargo.toml') }} | |
| - run: | | |
| cargo generate-lockfile | |
| cargo update -p half --precise 2.4.1 | |
| cargo update -p rayon --precise 1.10.0 | |
| cargo update -p rayon-core --precise 1.12.1 | |
| - run: cargo test | |
| env: | |
| RUSTFLAGS: "-Cinstrument-coverage" | |
| LLVM_PROFILE_FILE: "rust-cov/cov-%m-%p.profraw" | |
| - name: Compute coverage HTML | |
| run: | | |
| set -xe | |
| LIBDIR=$(rustc --print target-libdir) | |
| $LIBDIR/../bin/llvm-profdata merge -sparse rust-cov/*.profraw -o cargo-test-rust-cov.profdata | |
| $LIBDIR/../bin/llvm-cov export \ | |
| $( \ | |
| for file in \ | |
| $( \ | |
| RUSTFLAGS="-Cinstrument-coverage" \ | |
| cargo test --tests --no-run --message-format=json \ | |
| | jq -r "select(.profile.test == true) | .filenames[]" \ | |
| ); \ | |
| do \ | |
| printf "%s %s " -object $file; \ | |
| done \ | |
| ) \ | |
| -instr-profile=cargo-test-rust-cov.profdata \ | |
| --ignore-filename-regex='/.cargo/registry' \ | |
| --ignore-filename-regex='/rustc/' \ | |
| --ignore-filename-regex='/.rustup/toolchains/' --format=lcov > cargo-test.lcov | |
| genhtml cargo-test.lcov -o coverage-html | tee output.log | |
| - uses: actions/upload-artifact@v4.6.2 | |
| with: | |
| name: coverage-html | |
| path: coverage-html | |
| - name: Check coverage | |
| run: | | |
| import re | |
| with open("output.log") as f: | |
| [line] = [l for l in f if l.startswith(" lines......:")] | |
| coverage = float(re.search(r"([\d\.]+)%", line).group(1)) | |
| if coverage < 100: | |
| raise ValueError(f"Coverage too low: {coverage}") | |
| shell: python |