-
Notifications
You must be signed in to change notification settings - Fork 0
69 lines (65 loc) · 2.07 KB
/
test.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
name: test
on:
pull_request:
branches:
- "**"
workflow_call:
jobs:
build:
strategy:
fail-fast: false
matrix:
os: [ubuntu-24.04]
rust: [stable]
profile: [dev]
name: test
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ matrix.rust }}
- name: deps
run: |
sudo apt install -y build-essential autoconf clang-15 flex bison pkg-config autopoint
sudo ln -s /usr/include/asm-generic /usr/include/asm
sudo rm -f /bin/clang
sudo ln -s /usr/bin/clang-15 /bin/clang
- uses: Swatinem/rust-cache@v2
- name: cargo build
run: CLANG=clang-15 cargo build --bins --examples --profile=${{ matrix.profile }} --locked --verbose
- name: cargo test
run: cargo test -p stacks --profile=${{ matrix.profile }} --locked --verbose
- name: e2e test (should run as root)
run: |
if [ "${{ matrix.profile }}" = "dev" ]; then
cd e2e && RUST_LOG="stacks=debug" cargo test --profile=${{ matrix.profile }} --locked
else
echo "Error: Profile '${{ matrix.profile }}' is not expected."
exit 1
fi
clippy:
name: lint with clippy
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- name: deps
run: |
sudo apt install -y build-essential autoconf clang-14 flex bison pkg-config autopoint
sudo ln -s /usr/include/asm-generic /usr/include/asm
sudo rm -f /bin/clang
sudo ln -s /usr/bin/clang-14 /bin/clang
- uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt
- uses: Swatinem/rust-cache@v2
- run: cargo clippy --locked --no-deps --all-targets --tests -- -D warnings
rustfmt:
name: lint formatting
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@nightly
with:
components: rustfmt
- run: cargo fmt -- --check