-
Notifications
You must be signed in to change notification settings - Fork 27
63 lines (59 loc) · 2.23 KB
/
coverage.yaml
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
name: coverage
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
env:
CARGO_TERM_COLOR: always
jobs:
ubuntu-latest:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install Dependences
run: |
sudo apt update && sudo apt install -y gdb pip curl python3.10-dev llvm \
openjdk-17-jdk ca-certificates gnupg
pip3 install atheris
sudo mkdir -p /etc/apt/keyrings
curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | sudo gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg
export NODE_MAJOR=20
echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_$NODE_MAJOR.x nodistro main" | sudo tee /etc/apt/sources.list.d/nodesource.list
sudo apt update && sudo apt install -y nodejs
sudo npm install -g jsfuzz
sudo npm install --save-dev @jazzer.js/core
curl https://sh.rustup.rs -o rustup.sh && chmod +x rustup.sh && \
./rustup.sh -y && rm rustup.sh
rustup install nightly
export PATH=/root/.cargo/bin:$PATH
cargo install cargo-fuzz grcov
- name: Build and Run Tests
env:
CARGO_INCREMENTAL: 0
RUSTFLAGS: '-Cinstrument-coverage -Zprofile -Ccodegen-units=1 -Copt-level=0 -Clink-dead-code -Coverflow-checks=off -Zpanic_abort_tests -Cpanic=abort'
RUSTDOCFLAGS: '-Cpanic=abort'
LLVM_PROFILE_FILE: 'casr-%p-%m.profraw'
run: |
rustup component add llvm-tools-preview
cargo +nightly build --all-features --verbose
cargo +nightly test --verbose --lib -- --test-threads 1
cargo +nightly test --verbose --package casr
- name: Collect Coverage
run: |
mkdir target/coverage
grcov \
. \
--binary-path target/debug \
-s . \
-o lcov.info \
--ignore-not-existing \
--keep-only '*casr/src*' \
--excl-line '///' \
--excl-start '^(#\[cfg\(test\)\]|#\[test\])' \
--excl-stop '^}$' \
-t lcov
- name: Upload Coverage Reports to Codecov
uses: codecov/codecov-action@v3
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}