-
Notifications
You must be signed in to change notification settings - Fork 990
273 lines (265 loc) · 15.7 KB
/
Copy pathmulti-arch.yml
File metadata and controls
273 lines (265 loc) · 15.7 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
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
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
name: Multiple architectures
# START OF COMMON SECTION
on:
push:
branches: [ 'release/**' ]
pull_request:
types: [opened, synchronize, reopened, ready_for_review]
branches: [ '*' ]
# Weekday-morning cron (10:00 UTC) seeds the master-scoped ccache that PR runs
# restore: re-runs --build-only (compile only, no tests) on the
# default branch. PR runs are read-only (see ccache-setup).
schedule:
- cron: '20 10 * * 1-5'
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
# END OF COMMON SECTION
jobs:
# All former runner-per-config matrix entries build on one runner via
# .github/scripts/parallel-make-check.py (see os-check.yml for the full
# pattern): each config builds in its own out-of-tree ("VPATH") build
# directory off one checkout/autogen, on a pool of one-per-CPU worker
# threads, longest first.
my_matrix:
name: Multi-arch test
if: ${{ (github.repository_owner == 'wolfssl') && (github.event_name != 'pull_request' || github.event.pull_request.draft == false) }}
runs-on: ubuntu-22.04
# Generous for a cold ccache; warm reruns finish in a fraction.
timeout-minutes: 35
steps:
- uses: actions/checkout@v5
name: Checkout wolfSSL
- name: Install dependencies
uses: ./.github/actions/install-apt-deps
with:
packages: autoconf automake libtool build-essential crossbuild-essential-arm64 crossbuild-essential-armhf crossbuild-essential-riscv64 crossbuild-essential-armel qemu-user
ghcr-debs-tag: ubuntu-22.04-minimal
# ccache via the cross-platform composite; the script passes the
# compiler to configure as CC="ccache gcc" (or a per-config "cc").
- name: Set up ccache
uses: ./.github/actions/ccache-setup
with:
workflow-id: multi-arch
read-only: ${{ github.event_name == 'pull_request' }}
max-size: 500M
# NOTE: the old runner-per-config matrix combined an "include" list
# of four architectures with an "opts" axis; GitHub's include-merge
# rules made each arch entry overwrite the previous one, so only the
# last (armel) combinations actually ran. The JSON below restores the
# evidently intended aarch64/armhf/riscv64 x opts coverage alongside
# armel, except riscv64 x sp-math: configure rejects --enable-sp-math
# without SP, and riscv64's --enable-riscv-asm (unlike the other
# arches' --enable-sp-asm) does not bring it in. Cross builds run
# testwolfcrypt transparently under qemu-user (binfmt) with the
# matching QEMU_LD_PREFIX.
- name: Build all configs (parallel, out-of-tree)
run: |
cat > "$RUNNER_TEMP/multi-arch-configs.json" <<'EOF'
[
{"name": "arm64-o0", "minutes": 4,
"cc": "ccache aarch64-linux-gnu-gcc",
"configure": ["--host=aarch64-linux-gnu", "--enable-all",
"--disable-examples",
"CPPFLAGS=-pedantic -Wdeclaration-after-statement -Wnull-dereference -DTEST_LIBWOLFSSL_SOURCES_INCLUSION_SEQUENCE -DWOLFCRYPT_TEST_LINT",
"--enable-sp-asm", "--enable-armasm", "CFLAGS=-O0"],
"check": false,
"run": [["env", "QEMU_LD_PREFIX=/usr/aarch64-linux-gnu", "./wolfcrypt/test/testwolfcrypt"]]},
{"name": "armhf-o0", "minutes": 4,
"cc": "ccache arm-linux-gnueabihf-gcc",
"configure": ["--host=arm-linux-gnueabihf", "--enable-all",
"--disable-examples",
"CPPFLAGS=-pedantic -Wdeclaration-after-statement -Wnull-dereference -DTEST_LIBWOLFSSL_SOURCES_INCLUSION_SEQUENCE -DWOLFCRYPT_TEST_LINT",
"--enable-sp-asm", "CFLAGS=-O0"],
"check": false,
"run": [["env", "QEMU_LD_PREFIX=/usr/arm-linux-gnueabihf", "./wolfcrypt/test/testwolfcrypt"]]},
{"name": "riscv64-o0", "minutes": 4,
"cc": "ccache riscv64-linux-gnu-gcc",
"configure": ["--host=riscv64-linux-gnu", "--enable-all",
"--disable-examples",
"CPPFLAGS=-pedantic -Wdeclaration-after-statement -Wnull-dereference -DTEST_LIBWOLFSSL_SOURCES_INCLUSION_SEQUENCE -DWOLFCRYPT_TEST_LINT",
"--enable-riscv-asm", "CFLAGS=-O0"],
"check": false,
"run": [["env", "QEMU_LD_PREFIX=/usr/riscv64-linux-gnu", "./wolfcrypt/test/testwolfcrypt"]]},
{"name": "armel-o0", "minutes": 4,
"cc": "ccache arm-linux-gnueabi-gcc",
"configure": ["--host=arm-linux-gnueabi", "--enable-all",
"--disable-examples",
"CPPFLAGS=-pedantic -Wdeclaration-after-statement -Wnull-dereference -DTEST_LIBWOLFSSL_SOURCES_INCLUSION_SEQUENCE -DWOLFCRYPT_TEST_LINT",
"--enable-sp-asm", "CFLAGS=-marm -DWOLFSSL_SP_ARM_ARCH=6 -O0"],
"check": false,
"run": [["env", "QEMU_LD_PREFIX=/usr/arm-linux-gnueabi", "./wolfcrypt/test/testwolfcrypt"]]},
{"name": "arm64-o1-no-fp-ecc", "minutes": 3,
"cc": "ccache aarch64-linux-gnu-gcc",
"configure": ["--host=aarch64-linux-gnu", "--enable-all",
"--disable-examples",
"CPPFLAGS=-pedantic -Wdeclaration-after-statement -Wnull-dereference -DTEST_LIBWOLFSSL_SOURCES_INCLUSION_SEQUENCE -DWOLFCRYPT_TEST_LINT",
"--enable-sp-asm", "--enable-armasm", "CFLAGS=-O1 -UFP_ECC"],
"check": false,
"run": [["env", "QEMU_LD_PREFIX=/usr/aarch64-linux-gnu", "./wolfcrypt/test/testwolfcrypt"]]},
{"name": "arm64-os", "minutes": 3,
"cc": "ccache aarch64-linux-gnu-gcc",
"configure": ["--host=aarch64-linux-gnu", "--enable-all",
"--disable-examples",
"CPPFLAGS=-pedantic -Wdeclaration-after-statement -Wnull-dereference -DTEST_LIBWOLFSSL_SOURCES_INCLUSION_SEQUENCE -DWOLFCRYPT_TEST_LINT",
"--enable-sp-asm", "--enable-armasm", "CFLAGS=-Os"],
"check": false,
"run": [["env", "QEMU_LD_PREFIX=/usr/aarch64-linux-gnu", "./wolfcrypt/test/testwolfcrypt"]]},
{"name": "armhf-o1-no-fp-ecc", "minutes": 3,
"cc": "ccache arm-linux-gnueabihf-gcc",
"configure": ["--host=arm-linux-gnueabihf", "--enable-all",
"--disable-examples",
"CPPFLAGS=-pedantic -Wdeclaration-after-statement -Wnull-dereference -DTEST_LIBWOLFSSL_SOURCES_INCLUSION_SEQUENCE -DWOLFCRYPT_TEST_LINT",
"--enable-sp-asm", "CFLAGS=-O1 -UFP_ECC"],
"check": false,
"run": [["env", "QEMU_LD_PREFIX=/usr/arm-linux-gnueabihf", "./wolfcrypt/test/testwolfcrypt"]]},
{"name": "armhf-os", "minutes": 3,
"cc": "ccache arm-linux-gnueabihf-gcc",
"configure": ["--host=arm-linux-gnueabihf", "--enable-all",
"--disable-examples",
"CPPFLAGS=-pedantic -Wdeclaration-after-statement -Wnull-dereference -DTEST_LIBWOLFSSL_SOURCES_INCLUSION_SEQUENCE -DWOLFCRYPT_TEST_LINT",
"--enable-sp-asm", "CFLAGS=-Os"],
"check": false,
"run": [["env", "QEMU_LD_PREFIX=/usr/arm-linux-gnueabihf", "./wolfcrypt/test/testwolfcrypt"]]},
{"name": "riscv64-o1-no-fp-ecc", "minutes": 3,
"cc": "ccache riscv64-linux-gnu-gcc",
"configure": ["--host=riscv64-linux-gnu", "--enable-all",
"--disable-examples",
"CPPFLAGS=-pedantic -Wdeclaration-after-statement -Wnull-dereference -DTEST_LIBWOLFSSL_SOURCES_INCLUSION_SEQUENCE -DWOLFCRYPT_TEST_LINT",
"--enable-riscv-asm", "CFLAGS=-O1 -UFP_ECC"],
"check": false,
"run": [["env", "QEMU_LD_PREFIX=/usr/riscv64-linux-gnu", "./wolfcrypt/test/testwolfcrypt"]]},
{"name": "riscv64-os", "minutes": 3,
"cc": "ccache riscv64-linux-gnu-gcc",
"configure": ["--host=riscv64-linux-gnu", "--enable-all",
"--disable-examples",
"CPPFLAGS=-pedantic -Wdeclaration-after-statement -Wnull-dereference -DTEST_LIBWOLFSSL_SOURCES_INCLUSION_SEQUENCE -DWOLFCRYPT_TEST_LINT",
"--enable-riscv-asm", "CFLAGS=-Os"],
"check": false,
"run": [["env", "QEMU_LD_PREFIX=/usr/riscv64-linux-gnu", "./wolfcrypt/test/testwolfcrypt"]]},
{"name": "armel-o1-no-fp-ecc", "minutes": 3,
"cc": "ccache arm-linux-gnueabi-gcc",
"configure": ["--host=arm-linux-gnueabi", "--enable-all",
"--disable-examples",
"CPPFLAGS=-pedantic -Wdeclaration-after-statement -Wnull-dereference -DTEST_LIBWOLFSSL_SOURCES_INCLUSION_SEQUENCE -DWOLFCRYPT_TEST_LINT",
"--enable-sp-asm",
"CFLAGS=-marm -DWOLFSSL_SP_ARM_ARCH=6 -O1 -UFP_ECC"],
"check": false,
"run": [["env", "QEMU_LD_PREFIX=/usr/arm-linux-gnueabi", "./wolfcrypt/test/testwolfcrypt"]]},
{"name": "armel-os", "minutes": 3,
"cc": "ccache arm-linux-gnueabi-gcc",
"configure": ["--host=arm-linux-gnueabi", "--enable-all",
"--disable-examples",
"CPPFLAGS=-pedantic -Wdeclaration-after-statement -Wnull-dereference -DTEST_LIBWOLFSSL_SOURCES_INCLUSION_SEQUENCE -DWOLFCRYPT_TEST_LINT",
"--enable-sp-asm", "CFLAGS=-marm -DWOLFSSL_SP_ARM_ARCH=6 -Os"],
"check": false,
"run": [["env", "QEMU_LD_PREFIX=/usr/arm-linux-gnueabi", "./wolfcrypt/test/testwolfcrypt"]]},
{"name": "arm64-o2", "minutes": 2.5,
"cc": "ccache aarch64-linux-gnu-gcc",
"configure": ["--host=aarch64-linux-gnu", "--enable-all",
"--disable-examples",
"CPPFLAGS=-pedantic -Wdeclaration-after-statement -Wnull-dereference -DTEST_LIBWOLFSSL_SOURCES_INCLUSION_SEQUENCE -DWOLFCRYPT_TEST_LINT",
"--enable-sp-asm", "--enable-armasm", "CFLAGS=-O2"],
"check": false,
"run": [["env", "QEMU_LD_PREFIX=/usr/aarch64-linux-gnu", "./wolfcrypt/test/testwolfcrypt"]]},
{"name": "arm64-o2-sp-math", "minutes": 2.5,
"cc": "ccache aarch64-linux-gnu-gcc",
"configure": ["--host=aarch64-linux-gnu", "--enable-all",
"--disable-examples",
"CPPFLAGS=-pedantic -Wdeclaration-after-statement -Wnull-dereference -DTEST_LIBWOLFSSL_SOURCES_INCLUSION_SEQUENCE -DWOLFCRYPT_TEST_LINT",
"--enable-sp-asm", "--enable-armasm", "--enable-sp-math",
"CFLAGS=-O2"],
"check": false,
"run": [["env", "QEMU_LD_PREFIX=/usr/aarch64-linux-gnu", "./wolfcrypt/test/testwolfcrypt"]]},
{"name": "arm64-ofast", "minutes": 2.5,
"cc": "ccache aarch64-linux-gnu-gcc",
"configure": ["--host=aarch64-linux-gnu", "--enable-all",
"--disable-examples",
"CPPFLAGS=-pedantic -Wdeclaration-after-statement -Wnull-dereference -DTEST_LIBWOLFSSL_SOURCES_INCLUSION_SEQUENCE -DWOLFCRYPT_TEST_LINT",
"--enable-sp-asm", "--enable-armasm", "CFLAGS=-Ofast"],
"check": false,
"run": [["env", "QEMU_LD_PREFIX=/usr/aarch64-linux-gnu", "./wolfcrypt/test/testwolfcrypt"]]},
{"name": "armhf-o2", "minutes": 2.5,
"cc": "ccache arm-linux-gnueabihf-gcc",
"configure": ["--host=arm-linux-gnueabihf", "--enable-all",
"--disable-examples",
"CPPFLAGS=-pedantic -Wdeclaration-after-statement -Wnull-dereference -DTEST_LIBWOLFSSL_SOURCES_INCLUSION_SEQUENCE -DWOLFCRYPT_TEST_LINT",
"--enable-sp-asm", "CFLAGS=-O2"],
"check": false,
"run": [["env", "QEMU_LD_PREFIX=/usr/arm-linux-gnueabihf", "./wolfcrypt/test/testwolfcrypt"]]},
{"name": "armhf-o2-sp-math", "minutes": 2.5,
"cc": "ccache arm-linux-gnueabihf-gcc",
"configure": ["--host=arm-linux-gnueabihf", "--enable-all",
"--disable-examples",
"CPPFLAGS=-pedantic -Wdeclaration-after-statement -Wnull-dereference -DTEST_LIBWOLFSSL_SOURCES_INCLUSION_SEQUENCE -DWOLFCRYPT_TEST_LINT",
"--enable-sp-asm", "--enable-sp-math", "CFLAGS=-O2"],
"check": false,
"run": [["env", "QEMU_LD_PREFIX=/usr/arm-linux-gnueabihf", "./wolfcrypt/test/testwolfcrypt"]]},
{"name": "armhf-ofast", "minutes": 2.5,
"cc": "ccache arm-linux-gnueabihf-gcc",
"configure": ["--host=arm-linux-gnueabihf", "--enable-all",
"--disable-examples",
"CPPFLAGS=-pedantic -Wdeclaration-after-statement -Wnull-dereference -DTEST_LIBWOLFSSL_SOURCES_INCLUSION_SEQUENCE -DWOLFCRYPT_TEST_LINT",
"--enable-sp-asm", "CFLAGS=-Ofast"],
"check": false,
"run": [["env", "QEMU_LD_PREFIX=/usr/arm-linux-gnueabihf", "./wolfcrypt/test/testwolfcrypt"]]},
{"name": "riscv64-o2", "minutes": 2.5,
"cc": "ccache riscv64-linux-gnu-gcc",
"configure": ["--host=riscv64-linux-gnu", "--enable-all",
"--disable-examples",
"CPPFLAGS=-pedantic -Wdeclaration-after-statement -Wnull-dereference -DTEST_LIBWOLFSSL_SOURCES_INCLUSION_SEQUENCE -DWOLFCRYPT_TEST_LINT",
"--enable-riscv-asm", "CFLAGS=-O2"],
"check": false,
"run": [["env", "QEMU_LD_PREFIX=/usr/riscv64-linux-gnu", "./wolfcrypt/test/testwolfcrypt"]]},
{"name": "riscv64-ofast", "minutes": 2.5,
"cc": "ccache riscv64-linux-gnu-gcc",
"configure": ["--host=riscv64-linux-gnu", "--enable-all",
"--disable-examples",
"CPPFLAGS=-pedantic -Wdeclaration-after-statement -Wnull-dereference -DTEST_LIBWOLFSSL_SOURCES_INCLUSION_SEQUENCE -DWOLFCRYPT_TEST_LINT",
"--enable-riscv-asm", "CFLAGS=-Ofast"],
"check": false,
"run": [["env", "QEMU_LD_PREFIX=/usr/riscv64-linux-gnu", "./wolfcrypt/test/testwolfcrypt"]]},
{"name": "armel-o2", "minutes": 2.5,
"cc": "ccache arm-linux-gnueabi-gcc",
"configure": ["--host=arm-linux-gnueabi", "--enable-all",
"--disable-examples",
"CPPFLAGS=-pedantic -Wdeclaration-after-statement -Wnull-dereference -DTEST_LIBWOLFSSL_SOURCES_INCLUSION_SEQUENCE -DWOLFCRYPT_TEST_LINT",
"--enable-sp-asm", "CFLAGS=-marm -DWOLFSSL_SP_ARM_ARCH=6 -O2"],
"check": false,
"run": [["env", "QEMU_LD_PREFIX=/usr/arm-linux-gnueabi", "./wolfcrypt/test/testwolfcrypt"]]},
{"name": "armel-o2-sp-math", "minutes": 2.5,
"cc": "ccache arm-linux-gnueabi-gcc",
"configure": ["--host=arm-linux-gnueabi", "--enable-all",
"--disable-examples",
"CPPFLAGS=-pedantic -Wdeclaration-after-statement -Wnull-dereference -DTEST_LIBWOLFSSL_SOURCES_INCLUSION_SEQUENCE -DWOLFCRYPT_TEST_LINT",
"--enable-sp-asm", "--enable-sp-math",
"CFLAGS=-marm -DWOLFSSL_SP_ARM_ARCH=6 -O2"],
"check": false,
"run": [["env", "QEMU_LD_PREFIX=/usr/arm-linux-gnueabi", "./wolfcrypt/test/testwolfcrypt"]]},
{"name": "armel-ofast", "minutes": 2.5,
"cc": "ccache arm-linux-gnueabi-gcc",
"configure": ["--host=arm-linux-gnueabi", "--enable-all",
"--disable-examples",
"CPPFLAGS=-pedantic -Wdeclaration-after-statement -Wnull-dereference -DTEST_LIBWOLFSSL_SOURCES_INCLUSION_SEQUENCE -DWOLFCRYPT_TEST_LINT",
"--enable-sp-asm", "CFLAGS=-marm -DWOLFSSL_SP_ARM_ARCH=6 -Ofast"],
"check": false,
"run": [["env", "QEMU_LD_PREFIX=/usr/arm-linux-gnueabi", "./wolfcrypt/test/testwolfcrypt"]]}
]
EOF
.github/scripts/parallel-make-check.py \
${{ github.event_name == 'schedule' && '--build-only' || '' }} \
"$RUNNER_TEMP/multi-arch-configs.json"
- name: ccache stats
if: always()
run: ccache -s || true
- name: Upload logs on failure
if: failure()
uses: actions/upload-artifact@v6
with:
retention-days: 7
name: multi-arch-logs
path: |
build-*/make-check.log
build-*/test-suite.log
build-*/config.log
if-no-files-found: ignore