Skip to content

Commit

Permalink
ci: Improve ubuntu_22_rust_msrv
Browse files Browse the repository at this point in the history
Make the steps more deterministic by moving the Git checkout after all
dependencies are installed.

Signed-off-by: Mickaël Salaün <[email protected]>
  • Loading branch information
l0kod committed Sep 4, 2024
1 parent e645aa3 commit be97bd5
Showing 1 changed file with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -118,18 +118,21 @@ jobs:
LANDLOCK_CRATE_TEST_ABI: 3
steps:

- uses: actions/checkout@v4
with:
ref: ${{ matrix.commit }}

- name: Clone Landlock test tools
uses: actions/checkout@v4
with:
repository: landlock-lsm/landlock-test-tools
ref: ${{ env.LANDLOCK_TEST_TOOLS_COMMIT }}
path: landlock-test-tools

- name: Clone rust-landlock
uses: actions/checkout@v4
with:
ref: ${{ matrix.commit }}
path: rust-landlock

- name: Get MSRV
working-directory: rust-landlock
run: sed -n 's/^rust-version = "\([0-9.]\+\)"$/RUST_TOOLCHAIN=\1/p' Cargo.toml >> $GITHUB_ENV

- name: Install Rust MSRV
Expand All @@ -139,16 +142,20 @@ jobs:
rustup update ${{ env.RUST_TOOLCHAIN }}
- name: Build
working-directory: rust-landlock
run: rustup run ${{ env.RUST_TOOLCHAIN }} cargo build --verbose

- name: Build tests
working-directory: rust-landlock
run: rustup run ${{ env.RUST_TOOLCHAIN }} cargo build --tests --verbose

- name: Run tests against the local kernel (Landlock ABI ${{ env.LANDLOCK_CRATE_TEST_ABI }})
working-directory: rust-landlock
run: rustup run ${{ env.RUST_TOOLCHAIN }} cargo test --verbose

- name: Run tests against Linux 6.1
run: CARGO="rustup run ${{ env.RUST_TOOLCHAIN }} cargo" ./landlock-test-tools/test-rust.sh linux-6.1 2
working-directory: rust-landlock
run: CARGO="rustup run ${{ env.RUST_TOOLCHAIN }} cargo" ../landlock-test-tools/test-rust.sh linux-6.1 2

ubuntu_20_rust_stable:
runs-on: ubuntu-20.04
Expand Down

0 comments on commit be97bd5

Please sign in to comment.