-
Notifications
You must be signed in to change notification settings - Fork 0
87 lines (72 loc) · 3.04 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
name: coverage
on: [push, pull_request]
env:
BUILD_TYPE: Debug
jobs:
codecov:
timeout-minutes: 15
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
compiler:
- { pkg: clang, exe: 'clang++', version: 18 }
runs-on: ${{matrix.os}}
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.x'
- run: pip install -U Jinja2
- name: Get CMake and Ninja
uses: lukka/get-cmake@latest
with:
cmakeVersion: 3.26.1
ninjaVersion: 1.11.1
- name: Install Clang
run: |
wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add -
sudo apt-add-repository "deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy-${{matrix.compiler.version}} main"
sudo apt update
sudo apt install -y llvm-${{matrix.compiler.version}} ${{matrix.compiler.pkg}}-${{matrix.compiler.version}} libc++-dev libc++abi-dev
- name: Install dependencies
run: |
sudo apt update
sudo apt install libxrandr-dev libxinerama-dev libxcursor-dev libxi-dev libxext-dev wayland-protocols libwayland-dev libxkbcommon-dev
sudo apt install libgl-dev
- name: Configure
env:
CC: ${{matrix.compiler.pkg}}-${{matrix.compiler.version}}
CXX: ${{matrix.compiler.exe}}-${{matrix.compiler.version}}
run: cmake -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DFLUX_GRAPHICS_API=OpenGL -DFLUX_ENABLE_COVERAGE=ON -B ${{github.workspace}}/build/${{matrix.os}}-${{env.BUILD_TYPE}} -G Ninja
- name: Build
# Build your program with the given configuration
run: cmake --build ${{github.workspace}}/build/${{matrix.os}}-${{env.BUILD_TYPE}} --config ${{env.BUILD_TYPE}}
- name: Run tests
working-directory: ${{github.workspace}}/build/${{matrix.os}}-${{env.BUILD_TYPE}}
env:
CTEST_OUTPUT_ON_FAILURE: 1
run: ctest --timeout 30 -C Debug -j4
- name: Index the raw profile
working-directory: ${{github.workspace}}/build/${{matrix.os}}-${{env.BUILD_TYPE}}
run: |
llvm-profdata-${{matrix.compiler.version}} merge --output=coverage.profdata */default.profraw
- name: Create a line-oriented coverage report
working-directory: ${{github.workspace}}/build/${{matrix.os}}-${{env.BUILD_TYPE}}
run: |
object_files=$(find ./flux-*/ -type f -executable -not -path "./flux-playground/*")
object_list=("$object_files")
objects=$(for object in ${object_list}; do echo "-object=${object} "; done)
echo "$objects"
llvm-cov-${{matrix.compiler.version}} export -format=lcov -instr-profile=coverage.profdata ${objects} > coverage.lcov
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4
with:
directory: ${{github.workspace}}/build/${{matrix.os}}-${{env.BUILD_TYPE}}
token: ${{secrets.CODECOV_TOKEN}}
files: ./coverage.lcov
flags: codecov
name: flux
fail_ci_if_error: true
verbose: true