From 915623fd9e2a8164b3b2cb7bb59d565549fde586 Mon Sep 17 00:00:00 2001 From: Red Mushie Date: Sat, 30 Sep 2023 13:17:34 +0200 Subject: [PATCH] ci: Add platformio 'fs' target for filesystem only, and filter it out during firmware builds --- .github/workflows/ci-build.yml | 5 ++--- .github/workflows/targets.yml | 5 +++-- platformio.ini | 3 +++ 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci-build.yml b/.github/workflows/ci-build.yml index 5d9aaba5..ff59089d 100644 --- a/.github/workflows/ci-build.yml +++ b/.github/workflows/ci-build.yml @@ -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 }} @@ -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 diff --git a/.github/workflows/targets.yml b/.github/workflows/targets.yml index 5bb4f4e4..5867cfce 100644 --- a/.github/workflows/targets.yml +++ b/.github/workflows/targets.yml @@ -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. # @@ -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 diff --git a/platformio.ini b/platformio.ini index 9be9db7a..5e9a0ca4 100644 --- a/platformio.ini +++ b/platformio.ini @@ -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