Skip to content

Commit 89af722

Browse files
committed
btrfs-progs: ci: add workflow for code coverage
Enable gcov build and run all tests, collect lcov results as artifacts. Signed-off-by: David Sterba <[email protected]>
1 parent 7622b5a commit 89af722

File tree

1 file changed

+52
-0
lines changed

1 file changed

+52
-0
lines changed

.github/workflows/coverage.yml

+52
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
# Code coverage when running all the tests, lcov published as artifacts
2+
3+
name: Code coverage tests
4+
run-name: Code coverage tests
5+
on:
6+
push:
7+
branches:
8+
- coverage-test
9+
- master
10+
jobs:
11+
build:
12+
runs-on: ubuntu-latest
13+
steps:
14+
- uses: actions/checkout@v3
15+
- run: uname -a
16+
- run: sudo modprobe btrfs
17+
- run: sudo apt-get install -y pkg-config gcc liblzo2-dev libzstd-dev libblkid-dev uuid-dev zlib1g-dev libext2fs-dev e2fsprogs libudev-dev python3-sphinx libaio-dev liburing-dev attr jq lcov
18+
- name: Configure
19+
run: ./autogen.sh && ./configure
20+
- name: Make
21+
run: make V=1 D=gcov
22+
- name: Tests cli
23+
run: sudo make D=gcov TEST_LOG=dump test-cli
24+
- name: Tests mkfs
25+
run: sudo make D=gcov TEST_LOG=dump test-mkfs
26+
- name: Tests check
27+
run: sudo make D=gcov TEST_LOG=dump test-check
28+
- name: Tests check (lowmem)
29+
run: sudo make D=gcov TEST_LOG=dump test-check-lowmem
30+
- name: Tests misc
31+
run: sudo make D=gcov TEST_LOG=dump test-misc
32+
- name: Tests fuzz
33+
run: sudo make D=gcov TEST_LOG=dump test-fuzz
34+
- name: Tests json formatter
35+
run: make D=gcov test-json
36+
- name: Tests string-table formatter
37+
run: make D=gcov test-string-table
38+
- name: Libbtrfsutil test
39+
run: make D=gcov test-libbtrfsutil
40+
- name: Libbtrfs build test
41+
run: make D=gcov library-test
42+
- name: Tests hash (correctness)
43+
run: make D=gcov hash-vectest && ./hash-vectest
44+
- name: Generate lcov results
45+
run: |
46+
lcov -c -d . -o lcov-info
47+
genhtml -o lcov-out lcov-info
48+
- name: Save lcov results
49+
uses: actions/upload-artifact@v3
50+
with:
51+
name: lcov-out
52+
path: lcov-out

0 commit comments

Comments
 (0)