forked from adafruit/tinyuf2
-
Notifications
You must be signed in to change notification settings - Fork 0
84 lines (73 loc) · 2.37 KB
/
build_selftest.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
name: GhostFAT Selftest
on:
pull_request:
push:
repository_dispatch:
release:
types:
- created
jobs:
# ---------------------------------------
# Unit testing with ghostfat
# ---------------------------------------
GHOSTFAT:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
board:
# Alphabetical order
# test_ghostfat
- '4k'
- '4k_favicon'
- '32k'
- '32k_favicon'
- '512b'
- '512b_favicon'
- 'huge'
steps:
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: "3.x"
- name: Checkout code
uses: actions/checkout@v3
- name: Build
run: |
make --directory ports/test_ghostfat/ BOARD=${{ matrix.board }} all
- name: Copy known good filesystem image
# NOTE: test_huge's knowngood.img file starts as 1.5 GiB
# Compressing once with GZip results gives 85 MiB
# Compressing it a second time gives 10 MiB ...
# Therefore, store known good images double-compressed...
run: |
pushd ./ports/test_ghostfat/
cp ./boards/${{ matrix.board }}/knowngood.img.gz.gz ./_build/${{ matrix.board }}/
popd
- name: Decompress known good filesystem image
run: |
pushd ./ports/test_ghostfat/
gzip --decompress ./_build/${{ matrix.board }}/knowngood.img.gz.gz
gzip --decompress ./_build/${{ matrix.board }}/knowngood.img.gz
popd
- name: Execute native self-test
if: always()
run: |
pushd ./ports/test_ghostfat/_build/${{ matrix.board }}/
chmod +x ./tinyuf2-${{ matrix.board }}.elf
./tinyuf2-${{ matrix.board }}.elf
popd
- name: Compress newly generated self-test images
if: always()
run: |
pushd ./ports/test_ghostfat/_build/${{ matrix.board }}/
mv ghostfat.img ghostfat_${{ matrix.board }}.img
gzip --keep ghostfat_${{ matrix.board }}.img
gzip --keep --force --best ghostfat_${{ matrix.board }}.img.gz
popd
- name: Save newly generated self-test images as CI artifacts
if: always()
uses: actions/upload-artifact@v3
with:
name: ghostfat_selftest_images
path: ./ports/test_ghostfat/_build/${{ matrix.board }}/ghostfat_${{ matrix.board }}.img.gz.gz