forked from bytecodealliance/userfaultfd-rs
-
Notifications
You must be signed in to change notification settings - Fork 0
65 lines (52 loc) · 1.87 KB
/
rust.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
name: Rust
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
build:
# ubuntu-latest runs a recent kernel with /dev/userfaultfd support whereas
# ubuntu-20.04 has a 5.15 kernel. We run the job in both, so we can test
# both paths for creating the file descriptor, i.e. /dev/userfaultfd ioctl
# and userfaultfd syscall.
runs-on: ${{ matrix.runner }}
strategy:
matrix:
runner: [ ubuntu-latest, ubuntu-20.04 ]
steps:
- uses: actions/checkout@v2
# Keep this step, so that we can check that the Linux kernel is the one we
# expect, depending on the runner kernel.
- name: Check Linux version
run: uname -r
# /dev/userfaultfd is only present on ubuntu-latest.
- name: Setup access to /dev/userfaultfd
if: ${{ matrix.runner == 'ubuntu-latest' }}
run: sudo setfacl -m u:${USER}:rw /dev/userfaultfd
- name: Build
run: cargo build --verbose
- name: Run tests (Linux 4.11 support)
run: cargo test --verbose
- name: Run tests (Linux 4.14 support)
run: cargo test --verbose --features linux4_14
- name: Run tests (Linux 5.7 support)
if: ${{ matrix.runner == 'ubuntu-latest' }}
run: cargo test --verbose --features linux5_7
# On ubuntu-20.04 runner we need to make sure we have the proper kernel
# headers for building the correct bindings
- name: Run tests (Linux 5.7 support)
if: ${{ matrix.runner == 'ubuntu-20.04' }}
run:
sudo apt update &&
sudo apt install -y linux-headers-5.11.0-25-generic &&
export LINUX_HEADERS=/usr/src/linux-headers-5.11.0-25-generic &&
cargo test --verbose --features linux5_7
audit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Install Cargo Audit
run: cargo install cargo-audit
- name: Audit
run: cargo audit