-
Notifications
You must be signed in to change notification settings - Fork 503
141 lines (138 loc) · 4.17 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
name: "libcyphal_tests"
on:
push: # Further filtering is done in the jobs.
pull_request:
branches:
- main
- 'issue/*'
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.10
steps:
- uses: actions/checkout@v4
- name: Cache ext modules
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 git+https://github.com/OpenCyphal/[email protected]
- 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.10
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
- name: Cache ext modules
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 git+https://github.com/OpenCyphal/[email protected]
- name: run tests
env:
GTEST_COLOR: yes
run: >
./build-tools/bin/verify.py
--verbose
${{ matrix.build_flavor != 'Coverage' && '--asserts' || '--no-exceptions' }}
--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/*/**/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
needs: [warmup]
steps:
- uses: actions/checkout@v4
- name: Cache ext modules
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 git+https://github.com/OpenCyphal/[email protected]
- 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' }}
uses: actions/configure-pages@v5
- name: Upload docs
if: ${{ github.event_name != 'pull_request' }}
uses: actions/upload-pages-artifact@v3
with:
path: "build/docs/html/"
- name: upload-pr-docs
if: ${{ github.event_name == 'pull_request' }}
uses: actions/upload-artifact@v4
with:
name: pr-docs
path: "build/docs/html/"
if-no-files-found: error