diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 9ce7fa9..bd73fb6 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -43,14 +43,31 @@ jobs: outputs: commits: ${{ toJSON(steps.*.outputs.*) }} + get_test_tools: + runs-on: ubuntu-22.04 + defaults: + run: + working-directory: .. + steps: + - name: Clone Landlock test tools + uses: actions/checkout@v3 + with: + repository: landlock-lsm/landlock-test-tools + path: landlock-test-tools + fetch-depth: 0 + ref: ab616e087cffa4b6716ff026e589d0317e19aaa4 # v1.0.0 + ubuntu_20_rust_msrv: runs-on: ubuntu-20.04 - needs: commit_list + needs: [commit_list, get_test_tools] strategy: fail-fast: false matrix: commit: ${{ fromJSON(needs.commit_list.outputs.commits) }} + env: + LANDLOCK_CRATE_TEST_ABI: 1 steps: + - uses: actions/checkout@v3 with: ref: ${{ matrix.commit }} @@ -70,6 +87,12 @@ jobs: - name: Build tests run: rustup run ${{ env.RUST_TOOLCHAIN }} cargo build --tests --verbose + - name: Run tests against the local kernel (Landlock ABI ${{ env.LANDLOCK_CRATE_TEST_ABI }}) + 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 + ubuntu_20_rust_stable: runs-on: ubuntu-20.04 needs: commit_list @@ -80,6 +103,7 @@ jobs: env: LANDLOCK_CRATE_TEST_ABI: 1 steps: + - name: Install Rust stable run: | rm ~/.cargo/bin/{cargo-fmt,rustfmt} || : @@ -111,7 +135,7 @@ jobs: ubuntu_22_rust_stable: runs-on: ubuntu-22.04 - needs: commit_list + needs: [commit_list, get_test_tools] strategy: fail-fast: false matrix: @@ -121,6 +145,7 @@ jobs: # $CARGO is used by landlock-test-tools/test-rust.sh CARGO: rustup run stable cargo steps: + - name: Install Rust stable run: | rm ~/.cargo/bin/{cargo-fmt,rustfmt} || : @@ -134,19 +159,11 @@ jobs: - name: Run tests against the local kernel (Landlock ABI ${{ env.LANDLOCK_CRATE_TEST_ABI }}) run: $CARGO test --verbose - - name: Clone Landlock test tools - uses: actions/checkout@v3 - with: - repository: landlock-lsm/landlock-test-tools - path: landlock-test-tools - fetch-depth: 0 - ref: ab616e087cffa4b6716ff026e589d0317e19aaa4 # v1.0.0 - - name: Run tests against Linux 5.10 - run: ./landlock-test-tools/test-rust.sh linux-5.10 0 + run: ../landlock-test-tools/test-rust.sh linux-5.10 0 - name: Run tests against Linux 5.15 - run: ./landlock-test-tools/test-rust.sh linux-5.15 1 + run: ../landlock-test-tools/test-rust.sh linux-5.15 1 - name: Run tests against Linux 6.1 - run: ./landlock-test-tools/test-rust.sh linux-6.1 2 + run: ../landlock-test-tools/test-rust.sh linux-6.1 2