-
Notifications
You must be signed in to change notification settings - Fork 0
53 lines (45 loc) · 1.71 KB
/
build.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
name: Build
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
env:
VALGRINDFLAGS: --show-reachable=no --show-possibly-lost=no --fair-sched=yes
RUST_BACKTRACE: 1
jobs:
rust:
runs-on: ubuntu-latest
name: Build
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: true
- name: Setup
run: |
curl -L --proto '=https' --tlsv1.2 -sSf -O https://sourceware.org/pub/valgrind/valgrind-3.23.0.tar.bz2
tar -xf valgrind-3.23.0.tar.bz2
rm valgrind-3.23.0.tar.bz2
cd valgrind-3.23.0
./configure
sudo make install -j $(nproc) &
sudo apt install -y libc6-dbg &
curl -L --proto '=https' --tlsv1.2 -sSf https://raw.githubusercontent.com/cargo-bins/cargo-binstall/main/install-from-binstall-release.sh | bash &
rustup update &
wait
cargo binstall -y cargo-valgrind cargo-llvm-cov
- name: Check & Lint
run: RUSTFLAGS="-D warnings" cargo clippy --all-targets && cargo clippy -r --all-targets
- name: Test debug build
run: cd tests && cargo test --tests && cargo valgrind test --tests
- name: Test release build
run: cd tests && cargo test -r --tests && cargo valgrind test -r --tests
- name: Generate test coverage
run: cd tests && cargo llvm-cov --codecov --output-path codecov.json --disable-default-ignore-filename-regex --ignore-filename-regex \(.cargo/registry\|rustc\)
- name: Upload coverage reports to Codecov
uses: codecov/[email protected]
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: codecov.json
slug: davidzeng0/xx-core