2023-07-11 14:18:01 +00:00
|
|
|
# Code coverage when running all the tests, lcov published as artifacts
|
|
|
|
|
|
|
|
name: Code coverage tests
|
|
|
|
run-name: Code coverage tests
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches:
|
|
|
|
- coverage-test
|
|
|
|
- master
|
|
|
|
jobs:
|
|
|
|
build:
|
2024-06-13 00:58:25 +00:00
|
|
|
runs-on: ubuntu-24.04
|
2023-07-11 14:18:01 +00:00
|
|
|
steps:
|
2024-01-30 18:32:58 +00:00
|
|
|
- uses: actions/checkout@v4
|
2023-07-11 14:18:01 +00:00
|
|
|
- run: uname -a
|
|
|
|
- run: sudo modprobe btrfs
|
|
|
|
- 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
|
|
|
|
- name: Configure
|
2023-12-06 13:51:35 +00:00
|
|
|
run: ./autogen.sh && ./configure --disable-documentation
|
2023-07-11 14:18:01 +00:00
|
|
|
- name: Make
|
|
|
|
run: make V=1 D=gcov
|
|
|
|
- name: Tests cli
|
|
|
|
run: sudo make D=gcov TEST_LOG=dump test-cli
|
|
|
|
- name: Tests mkfs
|
|
|
|
run: sudo make D=gcov TEST_LOG=dump test-mkfs
|
|
|
|
- name: Tests check
|
|
|
|
run: sudo make D=gcov TEST_LOG=dump test-check
|
|
|
|
- name: Tests check (lowmem)
|
|
|
|
run: sudo make D=gcov TEST_LOG=dump test-check-lowmem
|
|
|
|
- name: Tests misc
|
|
|
|
run: sudo make D=gcov TEST_LOG=dump test-misc
|
|
|
|
- name: Tests fuzz
|
|
|
|
run: sudo make D=gcov TEST_LOG=dump test-fuzz
|
2024-01-17 02:27:35 +00:00
|
|
|
- name: Tests convert
|
|
|
|
run: sudo make D=gcov TEST_LOG=dump test-convert
|
2023-12-01 00:39:27 +00:00
|
|
|
- name: Test internal APIs
|
|
|
|
run: make D=gcov test-api
|
2023-07-11 14:18:01 +00:00
|
|
|
- name: Libbtrfsutil test
|
|
|
|
run: make D=gcov test-libbtrfsutil
|
|
|
|
- name: Libbtrfs build test
|
|
|
|
run: make D=gcov library-test
|
|
|
|
- name: Tests hash (correctness)
|
|
|
|
run: make D=gcov hash-vectest && ./hash-vectest
|
|
|
|
- name: Generate lcov results
|
|
|
|
run: |
|
|
|
|
lcov -c -d . -o lcov-info
|
|
|
|
genhtml -o lcov-out lcov-info
|
|
|
|
- name: Save lcov results
|
2024-01-30 18:32:58 +00:00
|
|
|
uses: actions/upload-artifact@v4
|
2023-07-11 14:18:01 +00:00
|
|
|
with:
|
|
|
|
name: lcov-out
|
|
|
|
path: lcov-out
|
2023-07-13 14:36:26 +00:00
|
|
|
- name: Upload coverage reports to Codecov
|
2024-01-30 18:32:58 +00:00
|
|
|
uses: codecov/codecov-action@v4
|
2023-07-13 14:36:26 +00:00
|
|
|
with:
|
|
|
|
token: ${{ secrets.CODECOV_TOKEN }}
|
|
|
|
files: ${{ github.workspace }}/lcov-info
|
2024-01-31 16:57:04 +00:00
|
|
|
- name: Save logs on failure
|
|
|
|
if: ${{ failure() }}
|
|
|
|
uses: actions/upload-artifact@v4
|
|
|
|
with:
|
|
|
|
name: test-results
|
|
|
|
path: "tests/*-results.txt"
|
|
|
|
if-no-files-found: ignore
|