Skip to content

Commit 59f4313

Browse files
committed
Add coveralls to actions
1 parent 88e40da commit 59f4313

File tree

2 files changed

+72
-2
lines changed

2 files changed

+72
-2
lines changed

.github/workflows/tests.yml

Lines changed: 70 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,30 @@ jobs:
2424
- name: Run tests
2525
run: cargo test --features profiling -- --nocapture
2626

27+
extrae-rs-executables:
28+
name: Run extrae-rs sw counter tests
29+
runs-on: ubuntu-latest
30+
31+
steps:
32+
- uses: actions/checkout@v4
33+
- name: Install Rust
34+
uses: actions-rs/toolchain@v1
35+
with:
36+
toolchain: stable
37+
38+
- name: Build everything
39+
run: cargo build --features profiling
40+
41+
- name: Enable perf permissions
42+
run: sudo sysctl -w kernel.perf_event_paranoid=1
43+
44+
- name: Run test threads
45+
run: |
46+
cargo run --bin program_declarative --features profiling
47+
cargo run --bin program_procedural --features profiling
48+
cargo run --bin program_tokio --features profiling
49+
cargo run --bin program_threads --features profiling
50+
2751
extrae-rs-hwcounters:
2852
name: Run extrae-rs sw counter tests
2953
runs-on: ubuntu-latest
@@ -44,4 +68,49 @@ jobs:
4468
- name: Run test threads
4569
env:
4670
EXTRAE_counters: "cpu-migrations,context-switches"
47-
run: ./target/debug/program_threads
71+
run: |
72+
cargo run --bin program_declarative --features profiling
73+
cargo run --bin program_procedural --features profiling
74+
cargo run --bin program_tokio --features profiling
75+
cargo run --bin program_threads --features profiling
76+
77+
78+
79+
coverage:
80+
name: Coverage on ubuntu
81+
runs-on: ubuntu-latest
82+
needs: [extrae-rs-tests, extrae-rs-executables, extrae-rs-hwcounters]
83+
steps:
84+
- uses: actions/checkout@v4
85+
- name: Install Rust
86+
uses: actions-rs/toolchain@v1
87+
with:
88+
toolchain: stable
89+
override: true
90+
91+
- name: Install grcov
92+
run: cargo install grcov
93+
94+
- name: Install llvm-tools
95+
run: rustup component add llvm-tools-preview
96+
97+
- name: Enable perf permissions
98+
run: sudo sysctl -w kernel.perf_event_paranoid=1
99+
100+
- name: Run tests with coverage
101+
env:
102+
EXTRAE_counters: "cpu-migrations,context-switches"
103+
RUSTFLAGS: "-Cinstrument-coverage"
104+
LLVM_PROFILE_FILE: "extrae-rs-%p-%m.profraw"
105+
run: |
106+
cargo run --bin program_declarative --features profiling
107+
cargo run --bin program_procedural --features profiling
108+
cargo run --bin program_tokio --features profiling
109+
cargo run --bin program_threads --features profiling
110+
grcov . --binary-path ./target/debug/ -s . -t lcov --branch --ignore-not-existing --ignore "/*" -o ./lcov.info
111+
112+
- name: Upload coverage to Coveralls
113+
uses: coverallsapp/github-action@master
114+
with:
115+
github-token: ${{ secrets.GITHUB_TOKEN }}
116+
path-to-lcov: ./lcov.info

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
/target
22
TRACEDIR_*
3-
.gdb_history
3+
.gdb_history
4+
*.profraw

0 commit comments

Comments
 (0)