Skip to content

Commit

Permalink
move ghostfat to its own callable workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
hathach committed May 31, 2024
1 parent 6b89cbc commit ec96a8a
Show file tree
Hide file tree
Showing 2 changed files with 54 additions and 43 deletions.
46 changes: 3 additions & 43 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -87,46 +87,6 @@ jobs:
# ---------------------------------------
ghostfat:
needs: set-matrix
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
board: ${{ fromJSON(needs.set-matrix.outputs.json)['test_ghostfat'].board }}

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Build
run: |
make -C ports/test_ghostfat/ BOARD=${{ matrix.board }} all
- name: Decompress known good filesystem image
run: |
# copy
cp ./boards/${{ matrix.board }}/knowngood.img.gz.gz ./_build/${{ matrix.board }}/
# 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...
gzip --decompress ./_build/${{ matrix.board }}/knowngood.img.gz.gz
gzip --decompress ./_build/${{ matrix.board }}/knowngood.img.gz
working-directory: ports/test_ghostfat

- name: Execute native self-test
run: |
chmod +x ./tinyuf2-${{ matrix.board }}.elf
./tinyuf2-${{ matrix.board }}.elf
# Compress (double) newly generated self-test images
mv ghostfat.img ghostfat_${{ matrix.board }}.img
gzip --keep ghostfat_${{ matrix.board }}.img
gzip --keep --force --best ghostfat_${{ matrix.board }}.img.gz
working-directory: ports/test_ghostfat/_build/${{ matrix.board }}

- name: Save newly generated self-test images as CI artifacts
uses: actions/upload-artifact@v3
with:
name: ghostfat_selftest_images
path: ./ports/test_ghostfat/_build/${{ matrix.board }}/ghostfat_${{ matrix.board }}.img.gz.gz
uses: ./.github/workflows/build_ghostfat.yml
with:
boards: ${{ toJSON(fromJSON(needs.set-matrix.outputs.json)['test_ghostfat'].board) }}
51 changes: 51 additions & 0 deletions .github/workflows/build_ghostfat.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: Testing ghostfat

on:
workflow_call:
inputs:
boards:
required: true
type: string

jobs:
board:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
board: ${{ fromJSON(inputs.boards) }}
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Build
run: |
make -C ports/test_ghostfat/ BOARD=${{ matrix.board }} all
- name: Decompress known good filesystem image
run: |
# 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...
cp ./boards/${{ matrix.board }}/knowngood.img.gz.gz ./_build/${{ matrix.board }}/
gzip --decompress ./_build/${{ matrix.board }}/knowngood.img.gz.gz
gzip --decompress ./_build/${{ matrix.board }}/knowngood.img.gz
working-directory: ports/test_ghostfat

- name: Execute native self-test
run: |
chmod +x ./tinyuf2-${{ matrix.board }}.elf
./tinyuf2-${{ matrix.board }}.elf
# Compress (double) newly generated self-test images
mv ghostfat.img ghostfat_${{ matrix.board }}.img
gzip --keep ghostfat_${{ matrix.board }}.img
gzip --keep --force --best ghostfat_${{ matrix.board }}.img.gz
working-directory: ports/test_ghostfat/_build/${{ matrix.board }}

- name: Save newly generated self-test images as CI artifacts
uses: actions/upload-artifact@v3
with:
name: ghostfat_selftest_images
path: ./ports/test_ghostfat/_build/${{ matrix.board }}/ghostfat_${{ matrix.board }}.img.gz.gz

0 comments on commit ec96a8a

Please sign in to comment.