-
Notifications
You must be signed in to change notification settings - Fork 9
88 lines (85 loc) · 3.55 KB
/
Copy pathcoverage.yml
File metadata and controls
88 lines (85 loc) · 3.55 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
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
name: coverage
on:
push:
branches: [ main, 'v1.*' ]
pull_request:
branches: [ main ]
env:
BRANCH_NAME: ${{ github.head_ref || github.ref_name }}
jobs:
build-and-test:
timeout-minutes: 10
runs-on: ubuntu-latest
strategy:
matrix:
PRESET: [clang-linux-debug]
WORK_ITEM: [CORO,FUNCORO,FUNC]
HWLOC: [ON,OFF]
steps:
- name: install-hwloc
run: sudo apt-get update && sudo apt-get install -y hwloc libhwloc-dev
- name: lstopo
run: lstopo
- uses: actions/checkout@v4
with:
repository: tzcnt/tmc-examples
ref: main
- name: branch-examples
continue-on-error: true
run: git fetch --tags && git checkout ${{env.BRANCH_NAME}}
- name: submodule-clone
run: >
cd submodules
&& git clone https://github.com/tzcnt/TooManyCooks.git
# If a branch with the same name exists in the dependency repos, use that. Otherwise, use main.
- name: submodule-branch-TMC
# continue-on-error: true # this should never fail if triggered from TMC workflow
run: cd submodules/TooManyCooks && git fetch && git checkout ${{env.BRANCH_NAME}}
- name: configure
run: cmake -G "Unix Makefiles" -DTMC_AS_SUBMODULE=ON -DTMC_COPY_COMPILE_COMMANDS=OFF -DTMC_USE_HWLOC=${{matrix.HWLOC}} -DTMC_WORK_ITEM=${{matrix.WORK_ITEM}} ${{matrix.WORK_ITEM == 'FUNC' && '-DTMC_TRIVIAL_TASK=ON' || ''}} -DCMD_COMPILE_FLAGS='-Werror;-fprofile-instr-generate;-fcoverage-mapping' -DCMD_LINK_FLAGS='-Wl,--build-id;-fprofile-instr-generate;-fcoverage-mapping' --preset ${{matrix.PRESET}} .
- name: build
run: cmake --build ./build/${{matrix.PRESET}} --parallel $(nproc) --target all
- name: run tests
run: LLVM_PROFILE_FILE=tests.profraw ./build/${{matrix.PRESET}}/tests/tests
# test_exceptions depends on unknown awaitables which are disabled during the regular tests
# thus it must be compiled and run separately
- name: run test_exceptions
run: LLVM_PROFILE_FILE=test_exceptions.profraw ./build/${{matrix.PRESET}}/tests/test_exceptions
- name: run test_fuzz_chan
run: LLVM_PROFILE_FILE=test_fuzz_chan.profraw ./build/${{matrix.PRESET}}/tests/test_fuzz_chan
- name: merge
run: |
llvm-profdata-18 merge -o coverage.profdata \
tests.profraw \
test_exceptions.profraw \
test_fuzz_chan.profraw
- name: export
run: |
llvm-cov-18 export -format=lcov -instr-profile coverage.profdata \
-object ./build/${{matrix.PRESET}}/tests/tests \
-object ./build/${{matrix.PRESET}}/tests/test_exceptions \
-object ./build/${{matrix.PRESET}}/tests/test_fuzz_chan \
-sources ./submodules/TooManyCooks/ \
> coverage_${{matrix.WORK_ITEM}}_${{matrix.HWLOC}}_${{github.sha}}.txt
- uses: actions/upload-artifact@v4
with:
name: coverage_${{matrix.WORK_ITEM}}_${{matrix.HWLOC}}_${{github.sha}}.txt
path: coverage_${{matrix.WORK_ITEM}}_${{matrix.HWLOC}}_${{github.sha}}.txt
retention-days: 1
overwrite: true
# generate coverage files in parallel for different TMC_WORK_ITEM configs
# but upload them together; codecov.io will merge them and show overall coverage
upload:
needs: [build-and-test]
timeout-minutes: 10
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/download-artifact@v4
with:
merge-multiple: true
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v5
with:
token: ${{secrets.CODECOV_TOKEN}}
slug: tzcnt/TooManyCooks