-
Notifications
You must be signed in to change notification settings - Fork 50
83 lines (77 loc) · 2.12 KB
/
ci.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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
# SPDX-License-Identifier: MIT
name: ci
on:
push:
pull_request:
schedule:
- cron: "0 4 * * *"
permissions:
contents: read
env:
CARGO_TERM_COLOR: always
jobs:
test:
name: Build and run tests (rust ${{ matrix.rust }})
runs-on: ubuntu-latest
strategy:
matrix:
rust:
- stable
- beta
- nightly
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Install linux-modules-extra-$(uname -r)
uses: tecolicom/actions-use-apt-tools@main
with:
tools: linux-modules-extra-$(uname -r)
- name: Insert required modules
run: |
sudo depmod
sudo modprobe -v zram
sudo modprobe -v zstd
- name: Install Rust
run: |
rm -f ~/.cargo/bin/*fmt ~/.cargo/bin/rust-analyzer
curl https://sh.rustup.rs -sSf | sh -s -- -y
- name: Install toolchain
run: |
rustup toolchain install ${{ matrix.rust }}
rustup default ${{ matrix.rust }}
- name: Build
run: make program CARGOFLAGS="--verbose"
- name: Run tests
run: make check CARGOFLAGS="--verbose"
rustfmt:
name: rustfmt
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Install Rust
run: |
rm -f ~/.cargo/bin/*fmt ~/.cargo/bin/rust-analyzer
curl https://sh.rustup.rs -sSf | sh -s -- -y
- name: Install toolchain
run: |
rustup toolchain install stable
rustup default stable
- name: Check formatting
run: cargo fmt -- --check
clippy:
name: clippy
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Install Rust
run: |
rm -f ~/.cargo/bin/*fmt ~/.cargo/bin/rust-analyzer
curl https://sh.rustup.rs -sSf | sh -s -- -y
- name: Install toolchain
run: |
rustup toolchain install nightly
rustup default nightly
- name: Validate clippy
run: make clippy CARGOFLAGS="-- -D warnings"