-
Notifications
You must be signed in to change notification settings - Fork 3
192 lines (183 loc) · 6.25 KB
/
cetlvast.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
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
name: "CETLVaSt"
on:
push: # Further filtering is done in the jobs.
pull_request:
branches:
- main
- 'issue/*'
release:
types: [ published ]
workflow_dispatch:
jobs:
verification:
if: >
contains(github.event.head_commit.message, '#verification') ||
contains(github.ref, '/main') ||
contains(github.ref, '/issue/') ||
(github.event_name == 'pull_request')
runs-on: ubuntu-latest
container: ghcr.io/opencyphal/toolshed:ts22.4.10
strategy:
matrix:
build_flavor: [Debug, Release]
exceptions: [exceptions, no-exceptions]
std: [14, 17, 20]
toolchain: [gcc, clang]
include:
- build_flavor: Coverage
exceptions: exceptions
std: 14
toolchain: gcc
exclude:
- build_flavor: Debug
exceptions: no-exceptions
std: 14
toolchain: gcc
steps:
- uses: actions/checkout@v4
- name: Cache ext modules
id: cetlvast-ext
uses: actions/cache@v4
env:
cache-name: cetlvast-ext-cache
with:
path: cetlvast/build_external
key: gtest_b796f7d44681514f58a683a3a71ff17c94edb0c1
- name: run tests
env:
GTEST_COLOR: yes
run: >
./build-tools/bin/verify.py
-v
--online
--asserts
--${{ matrix.exceptions }}
--build-flavor ${{ matrix.build_flavor }}
--cpp-standard ${{ matrix.std }}
--toolchain ${{ matrix.toolchain }}
test
- name: debug output
if: ${{ runner.debug == '1' }}
run: ls -lAhR build/
- name: upload-artifacts
uses: actions/upload-artifact@v3
with:
name: ${{ matrix.build_flavor }}-${{ matrix.exceptions }}-${{ matrix.std }}-${{ matrix.toolchain }}
path: |
build/compile_commands.json
build/*/**/coverage.xml
build/*/**/*-sonarqube.xml
build/*/**/gcovr_html/*.*
if-no-files-found: error
docs:
if: >
contains(github.event.head_commit.message, '#docs') ||
contains(github.ref, '/main') ||
contains(github.ref, '/issue/') ||
(github.event_name == 'pull_request')
runs-on: ubuntu-latest
container: ghcr.io/opencyphal/toolshed:ts22.4.10
steps:
- uses: actions/checkout@v4
- name: Cache ext modules
id: cetlvast-ext
uses: actions/cache@v4
env:
cache-name: cetlvast-ext-cache
with:
path: cetlvast/build_external
key: gtest_b796f7d44681514f58a683a3a71ff17c94edb0c1
- name: doc-gen
run: >
./build-tools/bin/verify.py
-v
--online
--asserts
--build-flavor Debug
--cpp-standard 14
build-docs
- name: Setup Pages
if: ${{ github.event_name != 'pull_request' }}
uses: actions/configure-pages@v3
- name: Upload docs
if: ${{ github.event_name != 'pull_request' }}
uses: actions/upload-pages-artifact@v1
with:
path: "build/suites/docs/html/"
- name: upload-pr-docs
if: ${{ github.event_name == 'pull_request' }}
uses: actions/upload-artifact@v3
with:
name: pr-docs
path: "build/suites/docs/html/"
if-no-files-found: error
sonarqube:
if: >
contains(github.event.head_commit.message, '#sonar') ||
contains(github.ref, '/main') ||
contains(github.ref, '/issue/') ||
(github.event_name == 'pull_request')
needs:
- verification
- docs
runs-on: ubuntu-latest
container: ghcr.io/opencyphal/toolshed:ts22.4.10
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis by sonarqube.
- name: Install sonar-scanner
uses: SonarSource/sonarcloud-github-c-cpp@v2
- name: Cache ext modules
id: cetlvast-ext
uses: actions/cache@v4
env:
cache-name: cetlvast-ext-cache
with:
path: cetlvast/build_external
key: gtest_b796f7d44681514f58a683a3a71ff17c94edb0c1
- uses: actions/download-artifact@v3
with:
name: Coverage-exceptions-14-gcc
path: build
- name: Run sonar-scanner
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
run: >
sonar-scanner
--define sonar.organization=opencyphal
--define sonar.projectKey=OpenCyphal_CETL
--define sonar.projectName=CETLVaSt
--define sonar.projectVersion=1.0
--define sonar.sources=include,cetlvast/suites/unittest/sonar.cpp
--define sonar.tests=cetlvast/suites/unittest,cetlvast/suites/docs/examples
--define sonar.test.inclusions=test_*.cpp,example_*.cpp
--define sonar.sourceEncoding=UTF-8
--define sonar.host.url=https://sonarcloud.io
--define sonar.cfamily.ignoreHeaderComments=false
--define sonar.coverage.exclusions="cetlvast/suites/unittest/**/*,cetlvast/suites/docs/examples/**/*,**/sonar.cpp"
--define sonar.cpd.exclusions="cetlvast/suites/unittest/**/*,cetlvast/suites/docs/examples/**/*,**/sonar.cpp"
--define sonar.cfamily.compile-commands="build/compile_commands.json"
--define sonar.cfamily.reportingCppStandardOverride=c++14
--define sonar.coverageReportPaths="build/suites/unittest/coverage.xml,build/suites/docs/examples/coverage.xml"
--define sonar.testExecutionReportPaths="build/suites/unittest/unittest-sonarqube.xml,build/suites/docs/examples/examples-sonarqube.xml"
deploy-docs:
if: ${{ (github.event_name == 'release' && !github.event.release.prerelease) || github.event_name == 'workflow_dispatch' }}
needs:
- sonarqube
# Grant GITHUB_TOKEN the permissions required to make a Pages deployment
permissions:
contents: read
pages: write # to deploy to Pages
id-token: write # to verify the deployment originates from an appropriate source
# Deploy to the github-pages environment
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
# Specify runner + deployment step
runs-on: ubuntu-latest
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v1