-
Notifications
You must be signed in to change notification settings - Fork 504
157 lines (154 loc) · 4.7 KB
/
tests.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
name: "libcyphal_test"
on:
push: # Further filtering is done in the jobs.
pull_request:
branches:
- main
- 'issue/*'
# To test use https://github.com/nektos/act and specify the event as "act"
# For example:
#
# act act -j verification --bind --reuse
#
# That command will run the verification job locally and bind the current directory
# into the container (You'll probably need to delete any existing build directory
# before running act).
jobs:
warmup:
if: >
contains(github.event.head_commit.message, '#verification') ||
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.3
steps:
- uses: actions/checkout@v4
if: ${{ github.event_name != 'act' }}
- name: Cache ext modules
if: ${{ github.event_name != 'act' }}
id: libcyphal-ext
uses: actions/cache@v4
env:
cache-name: libcyphal-ext-cache
with:
path: external
key: ${{ runner.os }}-${{ hashFiles('cmake/modules/*.cmake') }}
- name: get nunavut
# TODO: setup a venv, cache, and distribute to the other jobs.
run: >
pip install nunavut
- name: configure
run: >
./build-tools/bin/verify.py
--verbose
--asserts
--online
--cpp-standard 14
--build-flavor Debug
clean-configure
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.3
needs: [warmup]
strategy:
matrix:
build_flavor: [Release, Debug]
std: [14, 17, 20]
toolchain: [gcc, clang]
include:
- build_flavor: Coverage
std: 14
toolchain: gcc
steps:
- uses: actions/checkout@v4
if: ${{ github.event_name != 'act' }}
- name: Cache ext modules
if: ${{ github.event_name != 'act' }}
id: libcyphal-ext
uses: actions/cache@v4
env:
cache-name: libcyphal-ext-cache
with:
path: external
key: ${{ runner.os }}-${{ hashFiles('cmake/modules/*.cmake') }}
- name: get nunavut
run: >
pip install nunavut
- name: run tests
env:
GTEST_COLOR: yes
run: >
./build-tools/bin/verify.py
--verbose
--asserts
--cpp-standard ${{ matrix.std }}
--build-flavor ${{ matrix.build_flavor }}
--toolchain ${{ matrix.toolchain }}
test
- name: debug output
if: ${{ runner.debug == '1' }}
run: ls -lAhR build/
- name: upload-artifacts
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.build_flavor }}-${{ 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.3
needs: [warmup]
steps:
- uses: actions/checkout@v4
if: ${{ github.event_name != 'act' }}
- name: Cache ext modules
if: ${{ github.event_name != 'act' }}
id: libcyphal-ext
uses: actions/cache@v4
env:
cache-name: libcyphal-ext-cache
with:
path: external
key: ${{ runner.os }}-${{ hashFiles('cmake/modules/*.cmake') }}
- name: get nunavut
run: >
pip install nunavut
- name: doc-gen
run: >
./build-tools/bin/verify.py
--verbose
--asserts
--cpp-standard 14
--build-flavor Debug
build-docs
- name: Setup Pages
if: ${{ github.event_name != 'pull_request' && github.event_name != 'act' }}
uses: actions/configure-pages@v5
- name: Upload docs
if: ${{ github.event_name != 'pull_request' && github.event_name != 'act' }}
uses: actions/upload-pages-artifact@v3
with:
path: "build/docs/html/"
- name: upload-pr-docs
if: ${{ github.event_name == 'pull_request' && github.event_name != 'act' }}
uses: actions/upload-artifact@v4
with:
name: pr-docs
path: "build/docs/html/"
if-no-files-found: error