Skip to content

Commit

Permalink
ci: Add platformio 'fs' target for filesystem only, and filter it out…
Browse files Browse the repository at this point in the history
… during firmware builds
  • Loading branch information
redmushie committed Sep 30, 2023
1 parent 8aec931 commit 915623f
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
5 changes: 2 additions & 3 deletions .github/workflows/ci-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ name: ci-build
env:
NODE_VERSION: 16
PYTHON_VERSION: 3.11
PLATFORMIO_ENV: ShockLink
SHOCKLINK_API_DOMAIN: api.shocklink.net
SHOCKLINK_FW_VERSION: master-${{ github.sha }}

Expand Down Expand Up @@ -89,13 +88,13 @@ jobs:
path: WebUI/build/

- name: Build filesystem
run: pio run --target buildfs
run: pio run --target buildfs -e fs

- name: Upload internal filesystem artifact
uses: actions/upload-artifact@v3
with:
name: filesystem
path: .pio/build/${{ env.PLATFORMIO_ENV }}/littlefs.bin
path: .pio/build/fs/littlefs.bin
retention-days: 1
if-no-files-found: error

Expand Down
5 changes: 3 additions & 2 deletions .github/workflows/targets.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@ jobs:
# "--raw-input --slurp" Takes the previous output,
# -c Output in compact mode (no newlines or unnecessary spaces),
# split("\n") Splits it by line, turning it into an array,
# [ .[] | select(length > 0) ] Filters out empty lines (there is an empty trailing line usually),
# [ .[] | select(length > 0) Filters out empty lines (there is an empty trailing line usually),
# | select(. != "fs") ] Filters out the "fs" entry since that's only for building the filesystem,
# { board: ... } Wraps the whole thing into a JSON object with only a "board" key
# and the array in question as value.
#
Expand All @@ -49,4 +50,4 @@ jobs:
- name: Extract targets
id: extract
run: |
echo "matrix=$(sed -n "s/^\[env:\(.*\)]$/\1/p" platformio.ini | jq --raw-input --slurp -c '{ board: split("\n") | [ .[] | select(length > 0) ] }')" >> $GITHUB_OUTPUT
echo "matrix=$(sed -n "s/^\[env:\(.*\)]$/\1/p" platformio.ini | jq --raw-input --slurp -c '{ board: split("\n") | [ .[] | select(length > 0) | select(. != "fs") ] }')" >> $GITHUB_OUTPUT
3 changes: 3 additions & 0 deletions platformio.ini
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ extra_scripts =
upload_speed = 921600
monitor_speed = 115200

[env:fs]
# This exists so we don't build a filesystem per board.

[env:esp32]
board = az-delivery-devkit-v4

Expand Down

0 comments on commit 915623f

Please sign in to comment.