Skip to content

Commit

Permalink
ci: Use cargo-hack's --rust-version flag for msrv check
Browse files Browse the repository at this point in the history
This respects rust-version field in Cargo.toml, so it removes the need
to manage MSRV in both the CI file and Cargo.toml.
  • Loading branch information
taiki-e committed Jan 7, 2024
1 parent b57a7c3 commit 078c478
Showing 1 changed file with 5 additions and 12 deletions.
17 changes: 5 additions & 12 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -127,21 +127,14 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest]
# When updating this, the reminder to update the minimum supported
# Rust version in Cargo.toml.
rust: ['1.63']
steps:
- uses: actions/checkout@v4
- name: Install Rust
# --no-self-update is necessary because the windows environment cannot self-update rustup.exe.
run: rustup update ${{ matrix.rust }} --no-self-update && rustup default ${{ matrix.rust }}
- run: cargo build
- name: Install Other Targets
if: startsWith(matrix.os, 'ubuntu')
run: rustup target add x86_64-unknown-freebsd x86_64-unknown-netbsd
- run: cargo build --target x86_64-unknown-freebsd
- name: Install cargo-hack
uses: taiki-e/install-action@cargo-hack
- run: cargo hack build --no-dev-deps --rust-version
- run: cargo hack build --no-dev-deps --rust-version --target x86_64-unknown-freebsd
if: startsWith(matrix.os, 'ubuntu')
- run: cargo build --target x86_64-unknown-netbsd
- run: cargo hack build --no-dev-deps --rust-version --target x86_64-unknown-netbsd
if: startsWith(matrix.os, 'ubuntu')

clippy:
Expand Down

0 comments on commit 078c478

Please sign in to comment.