Skip to content

Commit

Permalink
Use --locked on MSRV build in CI
Browse files Browse the repository at this point in the history
This ensures that the MSRV lockfile is kept up-to-date.
  • Loading branch information
ramosbugs committed Sep 16, 2024
1 parent 03cb079 commit faa82c0
Showing 1 changed file with 14 additions and 12 deletions.
26 changes: 14 additions & 12 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,37 +51,39 @@ jobs:
# builds.
- name: Use Rust 1.65 lockfile
if: ${{ matrix.rust_os.rust == '1.65.0' }}
run: cp Cargo-1.65.lock Cargo.lock
run: |
cp Cargo-1.65.lock Cargo.lock
echo "CARGO_LOCKED=--locked" >> $GITHUB_ENV
- name: Run tests
run: cargo test --tests --examples
run: cargo ${CARGO_LOCKED} test --tests --examples
- name: Doc tests
run: |
cargo test --doc
cargo test --doc --no-default-features
cargo test --doc --all-features
cargo ${CARGO_LOCKED} test --doc
cargo ${CARGO_LOCKED} test --doc --no-default-features
cargo ${CARGO_LOCKED} test --doc --all-features
- name: Test with all features enabled
run: cargo test --all-features
run: cargo ${CARGO_LOCKED} test --all-features
# Curl without reqwest (examples will not build)
- name: Test with curl (w/o reqwest)
run: cargo test --tests --features curl --no-default-features
run: cargo ${CARGO_LOCKED} test --tests --features curl --no-default-features

- name: Check fmt
if: ${{ matrix.rust_os.rust == '1.65.0' }}
run: cargo fmt --all -- --check
run: cargo ${CARGO_LOCKED} fmt --all -- --check

- name: Clippy
if: ${{ matrix.rust_os.rust == '1.65.0' }}
run: cargo clippy --all --all-features -- --deny warnings
run: cargo ${CARGO_LOCKED} clippy --all --all-features -- --deny warnings

- name: Audit
if: ${{ matrix.rust_os.rust == 'stable' }}
run: |
cargo install --force cargo-audit
cargo ${CARGO_LOCKED} install --force cargo-audit
# The chrono thread safety issue doesn't affect this crate since the crate does not rely
# on the system's local time zone, only UTC. See:
# https://github.com/chronotope/chrono/issues/499#issuecomment-946388161
cargo audit --ignore RUSTSEC-2020-0159
cargo ${CARGO_LOCKED} audit --ignore RUSTSEC-2020-0159
- name: Check WASM build
run: cargo check --target wasm32-unknown-unknown
run: cargo ${CARGO_LOCKED} check --target wasm32-unknown-unknown

0 comments on commit faa82c0

Please sign in to comment.