Skip to content

Commit

Permalink
ci fixup
Browse files Browse the repository at this point in the history
  • Loading branch information
slyon committed Aug 9, 2023
1 parent deef634 commit d83169a
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 4 deletions.
8 changes: 5 additions & 3 deletions .github/workflows/check-coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,15 @@ jobs:
sudo apt update
sudo apt install python3-rich python3-coverage python3-pytest python3-pytest-cov curl meson gcovr expect libcmocka-dev python3-cffi libpython3-dev
sudo apt build-dep netplan.io
wget http://archive.ubuntu.com/ubuntu/pool/universe/g/gcovr/gcovr_5.2-1_all.deb
sudo dpkg -i gcovr*.deb # we need newer gcovr to make the gcovr.cfg:exclude setting work
# Runs the unit tests with coverage
- name: Run unit tests
run: |
meson setup _build --prefix=/usr -Db_coverage=true -Dunit_testing=true
meson compile -C _build
unbuffer meson test -C _build --verbose
meson setup _build-cov --prefix=/usr -Db_coverage=true -Dunit_testing=true
meson compile -C _build-cov
unbuffer meson test -C _build-cov --verbose
# Checks the coverage diff to the main branch
#- name: Upload coverage to Codecov
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ pre-coverage: _build-cov
meson compile -C _build-cov --verbose

check-coverage: pre-coverage
meson test -C _build-cov
meson test -C _build-cov --verbose

install: default
meson install -C _build --destdir $(DESTDIR)
Expand Down
6 changes: 6 additions & 0 deletions meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -108,12 +108,18 @@ if get_option('b_coverage')
gcovr = find_program('gcovr')
ninja = find_program('ninja')
grep = find_program('grep')
cat = find_program('cat')
test('coverage-c-output',
find_program('ninja'),
args: ['-C', meson.current_build_dir(), 'coverage'],
timeout: 60,
priority: -90, # run before 'coverage-c'
is_parallel: false)
test('coverage-c-cat',
cat,
args: [join_paths(meson.current_build_dir(), 'meson-logs', 'coverage.txt')],
priority: -98, # run before 'coverage-c'
is_parallel: false)
test('coverage-c',
grep,
args: ['^TOTAL.*100%$', join_paths(meson.current_build_dir(), 'meson-logs', 'coverage.txt')],
Expand Down

0 comments on commit d83169a

Please sign in to comment.