-
Notifications
You must be signed in to change notification settings - Fork 26
613 lines (540 loc) · 26.3 KB
/
toolbox.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
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
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
name: toolbox
on:
push:
branches:
- main
paths:
- '.github/workflows/toolbox.yml'
- '.github/matrix_release_includes.json'
- 'debian/**'
- 'test/test.py'
- 'scripts/**'
- '!docs/**'
- '!**/*.md'
pull_request:
paths:
- '.github/workflows/toolbox.yml'
- '.github/matrix_release_includes.json'
- 'test/test.py'
- 'scripts/**'
- '!docs/**'
- '!**/*.md'
release:
types: [published]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
matrix_prep:
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.set-matrix.outputs.matrix }}
steps:
- name: Harden Runner
uses: step-security/harden-runner@0080882f6c36860b6ba35c610c98ce87d4e2f26f # v2.10.2
with:
egress-policy: audit
- name: Harden Runner
uses: step-security/harden-runner@0080882f6c36860b6ba35c610c98ce87d4e2f26f # v2.10.2
with:
egress-policy: audit
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- uses: JoshuaTheMiller/conditional-build-matrix@81b51eb8d89e07b86404934b5fecde1cea1163a5 # v2.0.1
id: set-matrix
with:
inputFile: '.github/matrix_release_includes.json'
filter: '[?runOnBranch==`always`]'
create_archives:
if: |
${{ github.event_name == 'pull_request' || github.event_name == 'release' }}
timeout-minutes: 15
needs: [ matrix_prep ]
runs-on: ${{ matrix.runs_on }}
strategy:
matrix: ${{ fromJson(needs.matrix_prep.outputs.matrix) }}
steps:
- name: Harden Runner
uses: step-security/harden-runner@0080882f6c36860b6ba35c610c98ce87d4e2f26f # v2.10.2
with:
egress-policy: audit
- name: Checkout cmsis-toolbox repository
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
fetch-depth: 0
- name: Create folders
run: |
mkdir -p toolbox
- name: Download buildmgr release asset
uses: dsaltares/fetch-gh-release-asset@aa2ab1243d6e0d5b405b973c89fa4d06a2d0fff7 # master
with:
repo: "Open-CMSIS-Pack/devtools"
version: tags/tools/buildmgr/2.7.0
file: cbuild_install.sh
target: toolbox/cbuild_install.sh
token: ${{ secrets.GITHUB_TOKEN }}
- name: Download projmgr release asset
uses: dsaltares/fetch-gh-release-asset@aa2ab1243d6e0d5b405b973c89fa4d06a2d0fff7 # master
with:
repo: "Open-CMSIS-Pack/devtools"
version: tags/tools/projmgr/2.7.0
file: projmgr.zip
target: toolbox/projmgr.zip
token: ${{ secrets.GITHUB_TOKEN }}
- name: Download cbridge release assets
uses: dsaltares/fetch-gh-release-asset@aa2ab1243d6e0d5b405b973c89fa4d06a2d0fff7 # master
with:
repo: "Open-CMSIS-Pack/generator-bridge"
version: tags/v0.9.14
regex: true
file: "cbridge_.*\\.(zip|gz)"
target: "toolbox/"
token: ${{ secrets.GITHUB_TOKEN }}
- name: Download cbuild release assets
uses: dsaltares/fetch-gh-release-asset@aa2ab1243d6e0d5b405b973c89fa4d06a2d0fff7 # master
with:
repo: "Open-CMSIS-Pack/cbuild"
version: tags/v2.7.0
regex: true
file: "cbuild_.*\\.(zip|gz)"
target: "toolbox/"
token: ${{ secrets.GITHUB_TOKEN }}
- name: Download cbuild2cmake release assets
uses: dsaltares/fetch-gh-release-asset@aa2ab1243d6e0d5b405b973c89fa4d06a2d0fff7 # master
with:
repo: "Open-CMSIS-Pack/cbuild2cmake"
version: tags/v0.9.5
regex: true
file: "cbuild2cmake_.*\\.(zip|gz)"
target: "toolbox/"
token: ${{ secrets.GITHUB_TOKEN }}
- name: Download cpackget release assets
uses: dsaltares/fetch-gh-release-asset@aa2ab1243d6e0d5b405b973c89fa4d06a2d0fff7 # master
with:
repo: "Open-CMSIS-Pack/cpackget"
version: tags/v2.1.5
regex: true
file: "cpackget_.*\\.(zip|gz)"
target: "toolbox/"
token: ${{ secrets.GITHUB_TOKEN }}
- name: Download packchk release assets
uses: dsaltares/fetch-gh-release-asset@aa2ab1243d6e0d5b405b973c89fa4d06a2d0fff7 # master
with:
repo: "Open-CMSIS-Pack/devtools"
version: tags/tools/packchk/1.4.1
regex: true
file: "packchk-.*\\.(zip|tbz2)"
target: "toolbox/"
token: ${{ secrets.GITHUB_TOKEN }}
- name: Download svdconv release assets
uses: dsaltares/fetch-gh-release-asset@aa2ab1243d6e0d5b405b973c89fa4d06a2d0fff7 # master
with:
repo: "Open-CMSIS-Pack/devtools"
version: tags/tools/svdconv/3.3.47
regex: true
file: "svdconv-.*\\.(zip|tbz2)"
target: "toolbox/"
token: ${{ secrets.GITHUB_TOKEN }}
- name: Download vidx2pidx release assets
uses: dsaltares/fetch-gh-release-asset@aa2ab1243d6e0d5b405b973c89fa4d06a2d0fff7 # master
with:
repo: "Open-CMSIS-Pack/vidx2pidx"
version: tags/v0.0.4
regex: true
file: "vidx2pidx_.*\\.(zip|gz)"
target: "toolbox/"
token: ${{ secrets.GITHUB_TOKEN }}
- name: Create Directories
shell: bash
run: |
mkdir -p buildmgr
mkdir -p projmgr
mkdir -p cbridge
mkdir -p cbuild
mkdir -p cbuild2cmake
mkdir -p cpackget
mkdir -p packchk
mkdir -p svdconv
mkdir -p vidx2pidx
mkdir -p distribution/bin
mkdir -p distribution/etc
mkdir -p distribution/doc
working-directory: toolbox
- name: Unzip files Windows
if: ${{ matrix.target == 'windows'}}
shell: bash
run: |
unzip cbridge_\*_${{ matrix.target }}_${{ matrix.arch }}.zip -d cbridge
unzip cbuild_\*_${{ matrix.target }}_${{ matrix.arch }}.zip -d cbuild
unzip cbuild2cmake_\*_${{ matrix.target }}_${{ matrix.arch }}.zip -d cbuild2cmake
unzip cpackget_\*_${{ matrix.target }}_${{ matrix.arch }}.zip -d cpackget
unzip packchk\*-${{ matrix.target }}-${{ matrix.arch }}.zip -d packchk
unzip svdconv-\*-${{ matrix.target }}-${{ matrix.arch }}.zip -d svdconv
unzip vidx2pidx_\*_${{ matrix.target }}_${{ matrix.arch }}.zip -d vidx2pidx
unzip projmgr.zip -d projmgr
./cbuild_install.sh -x buildmgr
working-directory: toolbox
- name: Unzip files Linux Darwin
if: ${{ matrix.target == 'linux' || matrix.target == 'darwin'}}
shell: bash
run: |
tar -xvf cbridge_*_${{ matrix.target }}_${{ matrix.arch }}.tar.gz -C cbridge
tar -xvf cbuild_*_${{ matrix.target }}_${{ matrix.arch }}.tar.gz -C cbuild
tar -xvf cbuild2cmake_*_${{ matrix.target }}_${{ matrix.arch }}.tar.gz -C cbuild2cmake
tar -xvf cpackget_*_${{ matrix.target }}_${{ matrix.arch }}.tar.gz -C cpackget
tar -xvf packchk-*-${{ matrix.target }}-${{ matrix.arch }}.tbz2 -C packchk
tar -xvf svdconv-*-${{ matrix.target }}-${{ matrix.arch }}.tbz2 -C svdconv
tar -xvf vidx2pidx_*_${{ matrix.target }}_${{ matrix.arch }}.tar.gz -C vidx2pidx
unzip projmgr.zip -d projmgr
sudo chmod +x ./cbuild_install.sh && ./cbuild_install.sh -x buildmgr
working-directory: toolbox
- name: Unzip files Windows & amd64
if: ${{ matrix.target == 'windows' && matrix.arch == 'arm64' }}
shell: bash
run: |
unzip cbridge_\*_${{ matrix.target }}_amd64.zip -d cbridge_amd64
unzip cbuild_\*_${{ matrix.target }}_amd64.zip -d cbuild_amd64
unzip cbuild2cmake_\*_${{ matrix.target }}_amd64.zip -d cbuild2cmake_amd64
unzip cpackget_\*_${{ matrix.target }}_amd64.zip -d cpackget_amd64
unzip packchk\*-${{ matrix.target }}-amd64.zip -d packchk_amd64
unzip svdconv-\*-${{ matrix.target }}-amd64.zip -d svdconv_amd64
unzip vidx2pidx_\*_${{ matrix.target }}_amd64.zip -d vidx2pidx_amd64
working-directory: toolbox
- name: Unzip files Linux Darwin & amd64
if: ${{ (matrix.target == 'linux' || matrix.target == 'darwin') && matrix.arch == 'arm64'}}
shell: bash
run: |
mkdir -p projmgr_amd64
mkdir -p cbridge_amd64
mkdir -p cbuild_amd64
mkdir -p cbuild2cmake_amd64
mkdir -p cpackget_amd64
mkdir -p packchk_amd64
mkdir -p svdconv_amd64
mkdir -p vidx2pidx_amd64
tar -xvf cbridge_*_${{ matrix.target }}_amd64.tar.gz -C cbridge_amd64
tar -xvf cbuild_*_${{ matrix.target }}_amd64.tar.gz -C cbuild_amd64
tar -xvf cbuild2cmake_*_${{ matrix.target }}_amd64.tar.gz -C cbuild2cmake_amd64
tar -xvf cpackget_*_${{ matrix.target }}_amd64.tar.gz -C cpackget_amd64
tar -xvf packchk-*-${{ matrix.target }}-amd64.tbz2 -C packchk_amd64
tar -xvf svdconv-*-${{ matrix.target }}-amd64.tbz2 -C svdconv_amd64
tar -xvf vidx2pidx_*_${{ matrix.target }}_amd64.tar.gz -C vidx2pidx_amd64
working-directory: toolbox
- name: Copy Files amd64
if: ${{ matrix.arch == 'arm64'}}
shell: bash
run: |
mkdir -p cmsis-toolbox-${{ matrix.target }}-amd64/bin
cp ./buildmgr/bin/cbuildgen${{ matrix.temp_extension }}-amd64 ./cmsis-toolbox-${{ matrix.target }}-amd64/bin/cbuildgen${{ matrix.binary_extension }}
cp ./projmgr/bin/${{ matrix.target }}-amd64/csolution${{ matrix.binary_extension }} ./cmsis-toolbox-${{ matrix.target }}-amd64/bin/csolution${{ matrix.binary_extension }}
cp ./cbridge_amd64/*/cbridge${{ matrix.binary_extension }} ./cmsis-toolbox-${{ matrix.target }}-amd64/bin/cbridge${{ matrix.binary_extension }}
cp ./cbuild_amd64/*/cbuild${{ matrix.binary_extension }} ./cmsis-toolbox-${{ matrix.target }}-amd64/bin/cbuild${{ matrix.binary_extension }}
cp ./cbuild2cmake_amd64/*/cbuild2cmake${{ matrix.binary_extension }} ./cmsis-toolbox-${{ matrix.target }}-amd64/bin/cbuild2cmake${{ matrix.binary_extension }}
cp ./cpackget_amd64/*/cpackget${{ matrix.binary_extension }} ./cmsis-toolbox-${{ matrix.target }}-amd64/bin/cpackget${{ matrix.binary_extension }}
cp ./packchk_amd64/packchk${{ matrix.binary_extension }} ./cmsis-toolbox-${{ matrix.target }}-amd64/bin/packchk${{ matrix.binary_extension }}
cp ./svdconv_amd64/svdconv${{ matrix.binary_extension }} ./cmsis-toolbox-${{ matrix.target }}-amd64/bin/svdconv${{ matrix.binary_extension }}
cp ./vidx2pidx_amd64/*/vidx2pidx${{ matrix.binary_extension }} ./cmsis-toolbox-${{ matrix.target }}-amd64/bin/vidx2pidx${{ matrix.binary_extension }}
working-directory: toolbox
- name: Add execution permission to the binaries and set files ownership
if: ${{ (matrix.target == 'linux' || matrix.target == 'darwin') && matrix.arch == 'arm64'}}
run: |
sudo chmod -R +x bin/*
sudo chown -R root: *
working-directory: toolbox/cmsis-toolbox-${{ matrix.target }}-amd64
- name: Copy Files
shell: bash
run: |
curl https://raw.githubusercontent.com/Open-CMSIS-Pack/Open-CMSIS-Pack-Spec/v1.7.44/schema/PACK.xsd --output distribution/etc/PACK.xsd
curl https://raw.githubusercontent.com/Open-CMSIS-Pack/Open-CMSIS-Pack-Spec/v1.7.44/schema/PackIndex.xsd --output distribution/etc/PackIndex.xsd
cp ./buildmgr/bin/cbuildgen${{ matrix.temp_extension }}-${{ matrix.arch }} ./distribution/bin/cbuildgen${{ matrix.binary_extension }}
cp -r ./buildmgr/etc/* ./distribution/etc
rm ./distribution/etc/setup
cp ./projmgr/bin/${{ matrix.target }}-${{ matrix.arch }}/csolution${{ matrix.binary_extension }} ./distribution/bin/csolution${{ matrix.binary_extension }}
cp -r ./projmgr/etc/* ./distribution/etc
cp ./cbridge/*/cbridge${{ matrix.binary_extension }} ./distribution/bin/cbridge${{ matrix.binary_extension }}
cp ./cbridge/*/launch-MCUXpressoConfigTools* ./distribution/bin/
cp ./cbuild/*/cbuild${{ matrix.binary_extension }} ./distribution/bin/cbuild${{ matrix.binary_extension }}
cp ./cbuild2cmake/*/cbuild2cmake${{ matrix.binary_extension }} ./distribution/bin/cbuild2cmake${{ matrix.binary_extension }}
cp ./cpackget/*/cpackget${{ matrix.binary_extension }} ./distribution/bin/cpackget${{ matrix.binary_extension }}
cp ./packchk/packchk${{ matrix.binary_extension }} ./distribution/bin/packchk${{ matrix.binary_extension }}
cp ./svdconv/svdconv${{ matrix.binary_extension }} ./distribution/bin/svdconv${{ matrix.binary_extension }}
cp ./vidx2pidx/*/vidx2pidx${{ matrix.binary_extension }} ./distribution/bin/vidx2pidx${{ matrix.binary_extension }}
cp ../docs/LICENSE.txt ./distribution
cp ../docs/index.html ./distribution/doc
working-directory: toolbox
- name: Update toolchain config files
if: ${{ matrix.target == 'windows' }}
shell: bash
run: |
sed -i '/set(EXT/c\ set(EXT .exe)' ./distribution/etc/AC6.6.16.2.cmake
sed -i '/set(EXT/c\ set(EXT .exe)' ./distribution/etc/GCC.10.3.1.cmake
sed -i '/set(EXT/c\ set(EXT .exe)' ./distribution/etc/IAR.9.32.1.cmake
sed -i '/set(EXT/c\ set(EXT .exe)' ./distribution/etc/CLANG.17.0.1.cmake
working-directory: toolbox
- name: Create output folders
run: |
mkdir cmsis-toolbox-${{ matrix.target }}-${{ matrix.arch }}
cp -r distribution/* cmsis-toolbox-${{ matrix.target }}-${{ matrix.arch }}
working-directory: toolbox
- name: Add execution permission to the binaries and set files ownership
if: ${{ matrix.target == 'linux' || matrix.target == 'darwin'}}
run: |
sudo chmod -R +x bin/*
sudo chown -R root: *
working-directory: toolbox/cmsis-toolbox-${{ matrix.target }}-${{ matrix.arch }}
- name: Set up Python
uses: actions/setup-python@0b93645e9fea7318ecaed2b359559ac225c90a2b # v5.3.0
with:
python-version: '3.11'
cache: 'pip'
- name: Install pip dependencies
run: |
pip install --upgrade pip
pip install pyyaml
- name: Generate manifest file
shell: bash
run: |
# Get the toolbox version
TOOLBOX_VERSION=$(git describe --tags || echo "untagged")
# Set binary extension (default to empty string if not set)
BINARY_EXTENSION=${{ matrix.binary_extension }}
[ -z "$BINARY_EXTENSION" ] && BINARY_EXTENSION=""
# Get absolute path to the toolbox directory
TOOLBOX_ABS_PATH=$(pwd)/toolbox/cmsis-toolbox-${{ matrix.target }}-${{ matrix.arch }}
# Get host machine configuration
HOST=${{ matrix.target }}-${{ matrix.arch }}
# Run the Python script to generate the manifest file
python ./scripts/generate_manifest.py \
-d "$TOOLBOX_ABS_PATH" \
-v "$TOOLBOX_VERSION" \
-e "$BINARY_EXTENSION" \
--host "$HOST"
- name: Zip folders Windows
if: ${{ matrix.target == 'windows'}}
run: |
Compress-Archive -Path cmsis-toolbox-${{ matrix.target }}-${{ matrix.arch }} -Destination cmsis-toolbox-${{ matrix.target }}-${{ matrix.arch }}${{ matrix.archive_extension }}
working-directory: toolbox
- name: Zip folders Linux Darwin
if: ${{ matrix.target == 'linux' || matrix.target == 'darwin'}}
run: |
tar -czvf cmsis-toolbox-${{ matrix.target }}-${{ matrix.arch }}${{ matrix.archive_extension }} cmsis-toolbox-${{ matrix.target }}-${{ matrix.arch }}
working-directory: toolbox
- name: Archive binaries
uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3
with:
name: cmsis-toolbox-${{ matrix.target }}-${{ matrix.arch }}
path: ./toolbox/cmsis-toolbox-${{ matrix.target }}-${{ matrix.arch }}${{ matrix.archive_extension }}
retention-days: 1
if-no-files-found: error
# Debian Package
- name: Update dependencies
if: ${{ matrix.target == 'linux' && matrix.arch == 'amd64' }}
run: |
sudo apt-get update
sudo apt-get install ninja-build
- name: Create Debian Package
if: ${{ matrix.target == 'linux' && matrix.arch == 'amd64' }}
run: |
mkdir -p ./debian/build
cmake -G Ninja -S ./debian -B ./debian/build -DTOOLBOX_ROOT=$(realpath ./toolbox/cmsis-toolbox-linux-amd64) -DTOOLBOX_VERSION=$(echo ${{ github.ref }} | cut -d'/' -f3)
cd ./debian/build
cpack -G DEB
- name: Archive Debian Package
if: ${{ matrix.target == 'linux' && matrix.arch == 'amd64' }}
uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3
with:
name: cmsis-toolbox-debian-package
path: ./debian/build/cmsis-toolbox_*_amd64.deb
retention-days: 1
if-no-files-found: error
tests:
if: |
${{ github.event_name == 'pull_request' || github.event_name == 'release' }}
needs: [ create_archives ]
timeout-minutes: 15
runs-on: ${{ matrix.config.os }}
name: 'Test (${{ matrix.config.target }}, ${{ matrix.config.arch }})'
strategy:
fail-fast: true
matrix:
config:
- { os: macos-13, target: darwin, arch: amd64 }
- { os: macos-14, target: darwin, arch: arm64 }
- { os: windows-2019, target: windows, arch: amd64}
- { os: windows-2019, target: windows, arch: arm64}
- { os: ubuntu-20.04, target: linux, arch: amd64}
- { os: ubuntu-20.04, target: linux, arch: arm64}
steps:
- name: Harden Runner
uses: step-security/harden-runner@0080882f6c36860b6ba35c610c98ce87d4e2f26f # v2.10.2
with:
egress-policy: audit
- name: Checkout cmsis-toolbox
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
submodules: recursive
- name: Download cmsis toolbox ${{ matrix.config.target }} ${{ matrix.config.arch }}
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8
with:
name: cmsis-toolbox-${{ matrix.config.target }}-${{ matrix.config.arch }}
path: archive
- name: Create directory
run: |
mkdir -p toolbox
- name: unzip cmsis-toolbox windows archive
if: ${{ startsWith(matrix.config.os, 'windows') }}
run: unzip archive/cmsis-toolbox-${{ matrix.config.target }}-${{ matrix.config.arch }}.zip -d toolbox
- name: unzip cmsis-toolbox macos/linux archive
if: ${{ startsWith(matrix.config.os, 'macos') || startsWith(matrix.config.os, 'ubuntu') }}
run: tar -xvf archive/cmsis-toolbox-${{ matrix.config.target }}-${{ matrix.config.arch }}.tar.gz -C toolbox
- name: Set up Python
uses: actions/setup-python@0b93645e9fea7318ecaed2b359559ac225c90a2b # v5.3.0
with:
python-version: '3.10'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install pytest
- name: Test with pytest
run: |
pytest --base-path=toolbox/cmsis-toolbox-${{ matrix.config.target }}-${{ matrix.config.arch }} test/tests.py -rA --junitxml=test-results-${{ matrix.config.target }}-${{ matrix.config.arch }}.xml
- name: Archive test report
uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3
with:
name: toolbox-test-${{ matrix.config.target }}-${{ matrix.config.arch }}
path: ./test-results-*.xml
retention-days: 1
if-no-files-found: error
publish-test-results:
if: github.event_name != 'release'
name: "Publish Tests Results"
needs: [ tests ]
runs-on: ubuntu-latest
permissions:
contents: read
issues: read
checks: write
pull-requests: write
steps:
- name: Harden Runner
uses: step-security/harden-runner@0080882f6c36860b6ba35c610c98ce87d4e2f26f # v2.10.2
with:
egress-policy: audit
- name: Download Artifacts
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8
with:
path: artifacts
- name: publish test results
uses: EnricoMi/publish-unit-test-result-action/linux@170bf24d20d201b842d7a52403b73ed297e6645b # v2.18.0
with:
commit: ${{ github.event.workflow_run.head_sha }}
report_individual_runs: true
files: "artifacts/**/test-results-*.xml"
release:
if: ${{ github.event_name == 'release' }}
needs: [ tests ]
runs-on: ubuntu-20.04
timeout-minutes: 15
steps:
- name: Download cmsis toolbox windows amd64 zip
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8
with:
name: cmsis-toolbox-windows-amd64
path: toolbox/zip
- name: Download cmsis toolbox windows arm64 zip
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8
with:
name: cmsis-toolbox-windows-arm64
path: toolbox/zip
- name: Download cmsis toolbox linux amd64 zip
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8
with:
name: cmsis-toolbox-linux-amd64
path: toolbox/zip
- name: Download cmsis toolbox linux arm64 zip
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8
with:
name: cmsis-toolbox-linux-arm64
path: toolbox/zip
- name: Download cmsis toolbox darwin amd64 zip
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8
with:
name: cmsis-toolbox-darwin-amd64
path: toolbox/zip
- name: Download cmsis toolbox darwin arm64 zip
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8
with:
name: cmsis-toolbox-darwin-arm64
path: toolbox/zip
- name: Download test report windows-amd64
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8
with:
name: toolbox-test-windows-amd64
path: testreports/
- name: Download test report windows-arm64
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8
with:
name: toolbox-test-windows-arm64
path: testreports/
- name: Download unit test report linux-amd64
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8
with:
name: toolbox-test-linux-amd64
path: testreports/
- name: Download unit test report linux-arm64
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8
with:
name: toolbox-test-linux-arm64
path: testreports/
- name: Download unit test report darwin-amd64
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8
with:
name: toolbox-test-darwin-amd64
path: testreports/
- name: Download unit test report darwin-arm64
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8
with:
name: toolbox-test-darwin-arm64
path: testreports/
- name: Zip test reports
run: zip -r testreports.zip *
working-directory: testreports
- name: Attach test report archive to release assets
uses: svenstaro/upload-release-action@04733e069f2d7f7f0b4aebc4fbdbce8613b03ccd # v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: testreports/testreports.zip
tag: ${{ github.ref }}
overwrite: true
asset_name: testreports.zip
- name: Calculate checksums
run: |
sha256sum cmsis-toolbox-windows-amd64.zip --text > cmsis-toolbox-checksums.txt
sha256sum cmsis-toolbox-windows-arm64.zip --text >> cmsis-toolbox-checksums.txt
sha256sum cmsis-toolbox-linux-amd64.tar.gz --text >> cmsis-toolbox-checksums.txt
sha256sum cmsis-toolbox-linux-arm64.tar.gz --text >> cmsis-toolbox-checksums.txt
sha256sum cmsis-toolbox-darwin-amd64.tar.gz --text >> cmsis-toolbox-checksums.txt
sha256sum cmsis-toolbox-darwin-arm64.tar.gz --text >> cmsis-toolbox-checksums.txt
working-directory: toolbox/zip
- name: Attach installer to release assets
id: release_assets
uses: svenstaro/upload-release-action@04733e069f2d7f7f0b4aebc4fbdbce8613b03ccd # v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: toolbox/zip/cmsis-toolbox-*
tag: ${{ github.ref }}
overwrite: true
file_glob: true
# Debian Package
- name: Download Debian Package
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8
with:
name: cmsis-toolbox-debian-package
path: debian
- name: Attach Debian Package to release assets
uses: svenstaro/upload-release-action@04733e069f2d7f7f0b4aebc4fbdbce8613b03ccd # v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: debian/cmsis-toolbox_*_amd64.deb
tag: ${{ github.ref }}
overwrite: true
file_glob: true