-
Notifications
You must be signed in to change notification settings - Fork 103
109 lines (91 loc) · 2.82 KB
/
coverage.yml
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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
name: Coverage
on:
push:
branches:
- main
pull_request:
types: [opened, synchronize, reopened, ready_for_review]
concurrency:
group: ${{ github.workflow }}-${{ github.event.number && format('pr{0}', github.event.number) || github.ref_name }}
cancel-in-progress: true
jobs:
Run:
runs-on: ubuntu-24.04
env:
CCACHE_DIR: "/tmp/ccache"
NEEDRESTART_SUSPEND: yes
DEBIAN_FRONTEND: noninteractive
timeout-minutes: 60
steps:
- name: Check out code
uses: actions/checkout@v4
with:
# So we can determine the merge base
fetch-depth: 0
- name: Set up CCache
id: setup-ccache
run: |
sudo apt-get install ccache
mkdir --parents ${CCACHE_DIR}
# Find the merge base to avoid populating the cache with short lived cache entries
# and evicting those we care for - from `main`
echo "merge-base=$( git merge-base origin/main ${{ github.sha }} )" >> $GITHUB_OUTPUT
- name: CCache
uses: actions/cache@v4
with:
key: ccache-coverage-${{ steps.setup-ccache.outputs.merge-base }}
# if exact match isn't found, use the most recent entry for the task
restore-keys: |
ccache-coverage-
path: ${{ env.CCACHE_DIR }}
- name: Ensure ccache size
run: |
# a full build yielded 180M cache
echo "max_size = 250" > ${CCACHE_DIR}/ccache.conf
- name: Install dependencies
run: |
sudo --preserve-env apt-add-repository --yes ppa:mir-team/dev
sudo --preserve-env apt-get install --no-install-recommends \
dmz-cursor-theme \
glmark2-es2 \
glmark2-es2-wayland \
lcov \
mesa-utils \
ninja-build \
xwayland
sudo --preserve-env apt-get build-dep ./
- name: Configure
run: >
cmake
-DCMAKE_BUILD_TYPE=Coverage
-DMIR_RUN_PERFORMANCE_TESTS=ON
-DCMAKE_C_COMPILER_LAUNCHER=ccache
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache
-GNinja
-B build
${{ github.workspace }}
- name: Build
run: cmake --build build
- name: Clear CCache stats
run: ccache --show-stats --zero-stats
- name: Test
timeout-minutes: 10
env:
CTEST_OUTPUT_ON_FAILURE: 1
XDG_RUNTIME_DIR: /tmp
run: cmake --build build --target test
- name: Measure coverage
timeout-minutes: 10
run: cmake --build build --target coverage
- name: Send coverage report
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
directory: build
fail_ci_if_error: true
verbose: true
- if: ${{ failure() && runner.debug }}
name: Setup tmate session
uses: mxschmitt/action-tmate@v3
with:
limit-access-to-actor: true