Skip to content

Commit

Permalink
ci: Test with all meaningful kernels thanks to landlock-test-tools
Browse files Browse the repository at this point in the history
Test all Landlock ABI versions:
- Linux 5.10: no Landlock support
- Linux 5.15: ABI v1
- Linux 6.1: ABI v2

See https://github.com/landlock-lsm/landlock-test-tools

Signed-off-by: Mickaël Salaün <mic@digikod.net>
  • Loading branch information
l0kod committed Aug 9, 2023
1 parent 9ada920 commit c367681
Showing 1 changed file with 22 additions and 66 deletions.
88 changes: 22 additions & 66 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,91 +43,47 @@ jobs:
outputs:
commits: ${{ toJSON(steps.*.outputs.*) }}

ubuntu_20_rust_msrv:
runs-on: ubuntu-20.04
needs: commit_list
strategy:
fail-fast: false
matrix:
commit: ${{ fromJSON(needs.commit_list.outputs.commits) }}
steps:
- uses: actions/checkout@v3
with:
ref: ${{ matrix.commit }}

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

- name: Install Rust MSRV
run: |
rm ~/.cargo/bin/{cargo-fmt,rustfmt} || :
rustup default ${{ env.RUST_TOOLCHAIN }}
rustup update ${{ env.RUST_TOOLCHAIN }}
- name: Build
run: rustup run ${{ env.RUST_TOOLCHAIN }} cargo build --verbose

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

ubuntu_20_rust_stable:
runs-on: ubuntu-20.04
ubuntu_22_rust_stable:
runs-on: ubuntu-22.04
needs: commit_list
strategy:
fail-fast: false
matrix:
commit: ${{ fromJSON(needs.commit_list.outputs.commits) }}
env:
LANDLOCK_CRATE_TEST_ABI: 1
CARGO: rustup run stable cargo
steps:
- name: Install Rust stable
run: |
rm ~/.cargo/bin/{cargo-fmt,rustfmt} || :
rustup default stable
rustup component add rustfmt clippy
rustup update
- uses: actions/checkout@v3
with:
ref: ${{ matrix.commit }}

- name: Build
run: rustup run stable cargo build --verbose

- name: Run tests
run: rustup run stable cargo test --verbose

- name: Check format
run: rustup run stable cargo fmt --all -- --check

- name: Check source with Clippy
run: rustup run stable cargo clippy -- --deny warnings

- name: Check tests with Clippy
run: rustup run stable cargo clippy --tests -- --deny warnings

- name: Check documentation
run: rustup run stable cargo doc --no-deps
- name: Clone Landlock test tools
uses: actions/checkout@v3
with:
repository: landlock-lsm/landlock-test-tools
path: landlock-test-tools
fetch-depth: 0
ref: test

ubuntu_22_rust_stable:
runs-on: ubuntu-22.04
needs: commit_list
strategy:
fail-fast: false
matrix:
commit: ${{ fromJSON(needs.commit_list.outputs.commits) }}
env:
LANDLOCK_CRATE_TEST_ABI: 1
steps:
- name: Install Rust stable
- name: Lift limits
run: |
rm ~/.cargo/bin/{cargo-fmt,rustfmt} || :
rustup default stable
rustup update
sudo -s ulimit -Hl unlimited
sudo -s ulimit -l unlimited
sudo -s ulimit -Hc unlimited
sudo -s ulimit -c unlimited
- uses: actions/checkout@v3
with:
ref: ${{ matrix.commit }}
- name: Run tests against Linux 5.10
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

- name: Run tests
run: rustup run stable cargo test --verbose
- name: Run tests against Linux 6.1
run: ./landlock-test-tools/test-rust.sh linux-6.1 2

0 comments on commit c367681

Please sign in to comment.