-
Notifications
You must be signed in to change notification settings - Fork 0
107 lines (101 loc) · 3.12 KB
/
ci.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
name: tests
on:
push:
branches:
- main
- 'releases/**'
pull_request:
env:
OMPI_ALLOW_RUN_AS_ROOT: 1
OMPI_ALLOW_RUN_AS_ROOT_CONFIRM: 1
jobs:
build_base_container:
name: Build base container
runs-on: self-hosted
steps:
- uses: actions/checkout@v4.2.0
- uses: whoan/docker-build-with-cache-action@v8.0.2
id: docker-base-cache
with:
username: "${{ secrets.DOCKER_HUB_USERNAME }}"
password: "${{ secrets.DOCKER_HUB_TOKEN }}"
image_name: l3ster-ci
dockerfile: scripts/ci/Dockerfile.base
unit_tests_and_static_analysis:
name: Static analysis and unit tests
needs: build_base_container
runs-on: self-hosted
container: kubagalecki/l3ster-ci:latest
env:
BUILD_TYPE: Release
TOOLCHAIN_PATH: ../cmake/toolchains/StaticAnalysis.cmake
steps:
- uses: actions/checkout@v4.2.0
- name: Build and run tests
run: scripts/ci/build-and-run-tests.sh
- name: Cleanup
if: always()
run: rm -rf build/
sanitizers:
name: Sanitizers
needs: unit_tests_and_static_analysis
runs-on: self-hosted
container: kubagalecki/l3ster-ci:latest
env:
BUILD_TYPE: ${{ matrix.build_type }}
TOOLCHAIN_PATH: "../cmake/toolchains/${{ matrix.sanitizer }}Sanitizer.cmake"
strategy:
matrix:
build_type: [ Debug, Release ]
sanitizer: [ Address, UndefinedBehavior ] # Thread disabled, too many false positives with TBB
steps:
- uses: actions/checkout@v4.2.0
- name: Build and run tests
run: scripts/ci/build-and-run-tests.sh
- name: Cleanup
if: always()
run: rm -rf build/
deployment:
name: Deployment tests
needs: unit_tests_and_static_analysis
runs-on: self-hosted
container: kubagalecki/l3ster-ci:latest
env:
DEPLOYMENT_TESTS: true
BUILD_TYPE: Release
TOOLCHAIN_PATH: ../cmake/toolchains/StaticAnalysis.cmake
steps:
- uses: actions/checkout@v4.2.0
- name: Build and run tests
run: scripts/ci/build-and-run-tests.sh
- name: Cleanup
if: always()
run: rm -rf build/
coverage:
name: Code coverage
needs: [ sanitizers, deployment ]
runs-on: self-hosted
container: kubagalecki/l3ster-ci:latest
env:
BUILD_TYPE: Debug
TOOLCHAIN_PATH: ../cmake/toolchains/Coverage.cmake
steps:
- uses: actions/checkout@v4.2.0
- name: Build and run tests
run: scripts/ci/build-and-run-tests.sh
- name: Gather coverage results via gcovr
run: |
gcovr --verbose --xml --print-summary --exclude-unreachable-branches --exclude-throw-branches \
--gcov-executable gcov-12 \
--root "$GITHUB_WORKSPACE" \
--exclude "$GITHUB_WORKSPACE/tests/" \
--output "$GITHUB_WORKSPACE/coverage_report.xml" \
"$GITHUB_WORKSPACE/build/tests/"
- name: Cleanup
if: always()
run: rm -rf build/
- uses: codecov/codecov-action@v4.5.0
with:
token: ${{ secrets.CODECOV_TOKEN }}
fail_ci_if_error: true
verbose: true