From be97bd51cb4c6a03e68fe16f51512c0de3f0d373 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micka=C3=ABl=20Sala=C3=BCn?= Date: Wed, 4 Sep 2024 20:37:25 +0200 Subject: [PATCH] ci: Improve ubuntu_22_rust_msrv MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Make the steps more deterministic by moving the Git checkout after all dependencies are installed. Signed-off-by: Mickaël Salaün --- .github/workflows/rust.yml | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index b1f99f3f..70e93bd8 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -118,10 +118,6 @@ 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: @@ -129,7 +125,14 @@ jobs: 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 @@ -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