-
Notifications
You must be signed in to change notification settings - Fork 246
57 lines (51 loc) · 2 KB
/
Copy pathcheck-coverage.yml
File metadata and controls
57 lines (51 loc) · 2 KB
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
name: Unit tests & Coverage
# Controls when the action will run. Triggers the workflow on push or pull request
# events but only for the main branch
on:
push:
branches: [ main ]
pull_request:
branches: [ '**' ]
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "test-and-coverage"
test-and-coverage:
# The type of runner that the job will run on
runs-on: ubuntu-26.04
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2
# to fix test_terminal.py on GA (https://github.com/actions/runner/issues/241)
# Always include phased updates (LP: #1979244)
- name: Install build depends
run: |
echo "APT::Get::Always-Include-Phased-Updates \"true\";" | sudo tee /etc/apt/apt.conf.d/90phased-updates
sudo apt update
sudo apt install curl ubuntu-dev-tools devscripts equivs gcovr
pull-lp-source netplan.io
mk-build-deps -i -B -s sudo netplan.io-*/debian/control
rm -rf netplan.io-*/
# Runs the unit tests with coverage
- name: Run unit tests
run: |
meson setup _build-cov --prefix=/usr -Db_coverage=true -Dunit_testing=true
meson compile -C _build-cov
meson test -C _build-cov --verbose
# Checks the coverage diff to the main branch
#- name: Upload coverage to Codecov
# uses: codecov/codecov-action@v1
# with:
# name: check-coverage
# fail_ci_if_error: true
# verbose: true
- name: Archive build & test logs on failure
if: ${{ failure() }}
uses: actions/upload-artifact@v4
with:
name: build-cov-logs
path: |
_build-cov/meson-logs/
_build-cov/**/*.log
retention-days: 7
if-no-files-found: warn