From 35e47a24a139c271401dc7d6041d0a800667baa9 Mon Sep 17 00:00:00 2001 From: Will Tatam Date: Mon, 4 Mar 2024 22:55:04 +0000 Subject: [PATCH 01/13] matrix compile --- .github/workflows/pio.yml | 32 ++++++++++++++++++++++++++++++-- 1 file changed, 30 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pio.yml b/.github/workflows/pio.yml index ce34e695..1ca55987 100644 --- a/.github/workflows/pio.yml +++ b/.github/workflows/pio.yml @@ -3,9 +3,37 @@ name: PlatformIO CI on: [push] jobs: - build: + get_default_envs: + name: Gather Environments runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: Cache pip + uses: actions/cache@v3 + with: + path: ~/.cache/pip + key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }} + restore-keys: | + ${{ runner.os }}-pip- + - uses: actions/setup-python@v4 + with: + python-version: '3.9' + - name: Install PlatformIO + run: pip install -r requirements.txt + - name: Get default environments + id: envs + run: | + echo "environments=$(pio project config --json-output | jq -cr '.[0][1][0][1]')" >> $GITHUB_OUTPUT + outputs: + environments: ${{ steps.envs.outputs.environments }} + build: + runs-on: ubuntu-latest + needs: get_default_envs + strategy: + fail-fast: false + matrix: + environment: ${{ fromJSON(needs.get_default_envs.outputs.environments) }} steps: - uses: actions/checkout@v3 with: @@ -29,7 +57,7 @@ jobs: echo "git_hash=${git_hash}" >> $GITHUB_ENV echo "git_branch=${git_branch}" >> $GITHUB_ENV - name: Build PlatformIO Project - run: pio run + run: pio run -e ${{ matrix.environment }} - name: 'Upload Artifact' uses: actions/upload-artifact@v3 with: From a7202512cce2c58ec51571ddf0d73adce996ade6 Mon Sep 17 00:00:00 2001 From: Will Tatam Date: Mon, 4 Mar 2024 22:58:16 +0000 Subject: [PATCH 02/13] matrix compile --- .github/workflows/pio.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pio.yml b/.github/workflows/pio.yml index 1ca55987..367b4809 100644 --- a/.github/workflows/pio.yml +++ b/.github/workflows/pio.yml @@ -18,8 +18,8 @@ jobs: - uses: actions/setup-python@v4 with: python-version: '3.9' - - name: Install PlatformIO - run: pip install -r requirements.txt + - name: Install PlatformIO Core + run: pip install --upgrade platformio - name: Get default environments id: envs run: | From dda8d1825467a2498944787508198ad95b687d1a Mon Sep 17 00:00:00 2001 From: Will Tatam Date: Mon, 4 Mar 2024 23:12:42 +0000 Subject: [PATCH 03/13] matrix compile --- .github/workflows/pio.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pio.yml b/.github/workflows/pio.yml index 367b4809..57eb27c9 100644 --- a/.github/workflows/pio.yml +++ b/.github/workflows/pio.yml @@ -23,7 +23,7 @@ jobs: - name: Get default environments id: envs run: | - echo "environments=$(pio project config --json-output | jq -cr '.[0][1][0][1]')" >> $GITHUB_OUTPUT + echo "environments=$(pio project config --json-output | jq -cr '.[][0]' | grep 'env:'| awk -F: '{ print $2})" >> $GITHUB_OUTPUT outputs: environments: ${{ steps.envs.outputs.environments }} From 57f02a77c14354bbe39abfe62d9fa3d11edfa374 Mon Sep 17 00:00:00 2001 From: Will Tatam Date: Mon, 4 Mar 2024 23:13:31 +0000 Subject: [PATCH 04/13] matrix compile --- .github/workflows/pio.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pio.yml b/.github/workflows/pio.yml index 57eb27c9..2ba66c59 100644 --- a/.github/workflows/pio.yml +++ b/.github/workflows/pio.yml @@ -23,7 +23,7 @@ jobs: - name: Get default environments id: envs run: | - echo "environments=$(pio project config --json-output | jq -cr '.[][0]' | grep 'env:'| awk -F: '{ print $2})" >> $GITHUB_OUTPUT + echo "environments=$(pio project config --json-output | jq -cr '.[][0]' | grep 'env:'| awk -F: '{ print $2}')" >> $GITHUB_OUTPUT outputs: environments: ${{ steps.envs.outputs.environments }} From 942c48f908dd7c7bbd5209aab82fcc19afe0c5cd Mon Sep 17 00:00:00 2001 From: Will Tatam Date: Mon, 4 Mar 2024 23:17:36 +0000 Subject: [PATCH 05/13] matrix compile --- .github/workflows/pio.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pio.yml b/.github/workflows/pio.yml index 2ba66c59..9148338f 100644 --- a/.github/workflows/pio.yml +++ b/.github/workflows/pio.yml @@ -23,7 +23,7 @@ jobs: - name: Get default environments id: envs run: | - echo "environments=$(pio project config --json-output | jq -cr '.[][0]' | grep 'env:'| awk -F: '{ print $2}')" >> $GITHUB_OUTPUT + echo "environments=$(pio project config --json-output | jq -cr '.[][0]' | grep 'env:'| awk -F: '{ print $2" "}' | tr -d '\n')" >> $GITHUB_OUTPUT outputs: environments: ${{ steps.envs.outputs.environments }} From 0fb191f392666ab18f56be1814321b45723bcf9a Mon Sep 17 00:00:00 2001 From: Will Tatam Date: Mon, 4 Mar 2024 23:22:59 +0000 Subject: [PATCH 06/13] matrix compile --- .github/workflows/pio.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/pio.yml b/.github/workflows/pio.yml index 9148338f..a0289862 100644 --- a/.github/workflows/pio.yml +++ b/.github/workflows/pio.yml @@ -24,6 +24,7 @@ jobs: id: envs run: | echo "environments=$(pio project config --json-output | jq -cr '.[][0]' | grep 'env:'| awk -F: '{ print $2" "}' | tr -d '\n')" >> $GITHUB_OUTPUT + cat $GITHUB_OUTPUT outputs: environments: ${{ steps.envs.outputs.environments }} From 2da726a73b50705f59186388641fb8bb6a523385 Mon Sep 17 00:00:00 2001 From: Will Tatam Date: Mon, 4 Mar 2024 23:24:42 +0000 Subject: [PATCH 07/13] matrix compile --- .github/workflows/pio.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pio.yml b/.github/workflows/pio.yml index a0289862..e4c2d041 100644 --- a/.github/workflows/pio.yml +++ b/.github/workflows/pio.yml @@ -23,7 +23,7 @@ jobs: - name: Get default environments id: envs run: | - echo "environments=$(pio project config --json-output | jq -cr '.[][0]' | grep 'env:'| awk -F: '{ print $2" "}' | tr -d '\n')" >> $GITHUB_OUTPUT + echo "environments=\"$(pio project config --json-output | jq -cr '.[][0]' | grep 'env:'| awk -F: '{ print $2" "}' | tr -d '\n')\"" >> $GITHUB_OUTPUT cat $GITHUB_OUTPUT outputs: environments: ${{ steps.envs.outputs.environments }} @@ -34,7 +34,7 @@ jobs: strategy: fail-fast: false matrix: - environment: ${{ fromJSON(needs.get_default_envs.outputs.environments) }} + environment: ${{ needs.get_default_envs.outputs.environments }} steps: - uses: actions/checkout@v3 with: From 066b7ec39c7d2bd288eab205b1003d82d93e4c51 Mon Sep 17 00:00:00 2001 From: Will Tatam Date: Mon, 4 Mar 2024 23:50:09 +0000 Subject: [PATCH 08/13] matrix compile --- .github/workflows/pio.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pio.yml b/.github/workflows/pio.yml index e4c2d041..e996e05b 100644 --- a/.github/workflows/pio.yml +++ b/.github/workflows/pio.yml @@ -23,7 +23,8 @@ jobs: - name: Get default environments id: envs run: | - echo "environments=\"$(pio project config --json-output | jq -cr '.[][0]' | grep 'env:'| awk -F: '{ print $2" "}' | tr -d '\n')\"" >> $GITHUB_OUTPUT + echo -n "environments=" >> $GITHUB_OUTPUT + jq -c -n '$ARGS.positional' --args $(pio project config --json-output | jq -cr '.[][0]' | grep 'env:'| awk -F: '{ print $2" "}' | tr -d '\n') >> $GITHUB_OUTPUT cat $GITHUB_OUTPUT outputs: environments: ${{ steps.envs.outputs.environments }} @@ -34,7 +35,7 @@ jobs: strategy: fail-fast: false matrix: - environment: ${{ needs.get_default_envs.outputs.environments }} + environment: ${{ fromJSON(needs.get_default_envs.outputs.environments) }} steps: - uses: actions/checkout@v3 with: From 0538044adbb8fabbf174b883c83941df0c2382a1 Mon Sep 17 00:00:00 2001 From: Will Tatam Date: Mon, 4 Mar 2024 23:51:37 +0000 Subject: [PATCH 09/13] matrix compile --- .github/workflows/pio.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pio.yml b/.github/workflows/pio.yml index e996e05b..1a4411ed 100644 --- a/.github/workflows/pio.yml +++ b/.github/workflows/pio.yml @@ -23,8 +23,8 @@ jobs: - name: Get default environments id: envs run: | - echo -n "environments=" >> $GITHUB_OUTPUT - jq -c -n '$ARGS.positional' --args $(pio project config --json-output | jq -cr '.[][0]' | grep 'env:'| awk -F: '{ print $2" "}' | tr -d '\n') >> $GITHUB_OUTPUT + echo -n "environments=" >> $GITHUB_OUTPUT + jq -c -n '$ARGS.positional' --args $(pio project config --json-output | jq -cr '.[][0]' | grep 'env:'| awk -F: '{ print $2" "}' | tr -d '\n') >> $GITHUB_OUTPUT cat $GITHUB_OUTPUT outputs: environments: ${{ steps.envs.outputs.environments }} From af04f3c47a8ed4408027443dd9d2bc95a863ff9a Mon Sep 17 00:00:00 2001 From: Will Tatam Date: Tue, 5 Mar 2024 00:02:48 +0000 Subject: [PATCH 10/13] matrix compile --- .github/workflows/pio.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pio.yml b/.github/workflows/pio.yml index 1a4411ed..915658a4 100644 --- a/.github/workflows/pio.yml +++ b/.github/workflows/pio.yml @@ -63,7 +63,7 @@ jobs: - name: 'Upload Artifact' uses: actions/upload-artifact@v3 with: - name: StarMod-esp32-${{env.git_branch}}-${{env.git_hash}}.bin - path: .pio/build/esp32dev/firmware.bin + name: StarMod-${{ matrix.environment }}-${{env.git_branch}}-${{env.git_hash}}.bin + path: .pio/build/${{ matrix.environment }/firmware.bin retention-days: 30 From 7a16a4c75c4e5f254570a4b897f8fd9ca47022b8 Mon Sep 17 00:00:00 2001 From: Will Tatam Date: Tue, 5 Mar 2024 00:03:43 +0000 Subject: [PATCH 11/13] matrix compile --- .github/workflows/pio.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/pio.yml b/.github/workflows/pio.yml index 915658a4..bdcf0b95 100644 --- a/.github/workflows/pio.yml +++ b/.github/workflows/pio.yml @@ -63,7 +63,7 @@ jobs: - name: 'Upload Artifact' uses: actions/upload-artifact@v3 with: - name: StarMod-${{ matrix.environment }}-${{env.git_branch}}-${{env.git_hash}}.bin - path: .pio/build/${{ matrix.environment }/firmware.bin - retention-days: 30 + name: StarMod-${{ matrix.environment }}-${{env.git_branch}}-${{env.git_hash}}.bin + path: .pio/build/${{ matrix.environment }/firmware.bin + retention-days: 30 From 122a2b8f59636f444ae3d111ba4eb00a3e34c212 Mon Sep 17 00:00:00 2001 From: Will Tatam Date: Tue, 5 Mar 2024 00:04:46 +0000 Subject: [PATCH 12/13] matrix compile --- .github/workflows/pio.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pio.yml b/.github/workflows/pio.yml index bdcf0b95..48fc07f4 100644 --- a/.github/workflows/pio.yml +++ b/.github/workflows/pio.yml @@ -64,6 +64,6 @@ jobs: uses: actions/upload-artifact@v3 with: name: StarMod-${{ matrix.environment }}-${{env.git_branch}}-${{env.git_hash}}.bin - path: .pio/build/${{ matrix.environment }/firmware.bin + path: .pio/build/${{ matrix.environment }}/firmware.bin retention-days: 30 From 32d5e2806959e0a4c184381600cf12d3bb7967ce Mon Sep 17 00:00:00 2001 From: Will Tatam Date: Tue, 5 Mar 2024 00:08:27 +0000 Subject: [PATCH 13/13] matrix compile --- .github/workflows/pio.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pio.yml b/.github/workflows/pio.yml index 48fc07f4..361ef062 100644 --- a/.github/workflows/pio.yml +++ b/.github/workflows/pio.yml @@ -45,7 +45,7 @@ jobs: path: | ~/.cache/pip ~/.platformio/.cache - key: ${{ runner.os }}-pio + key: ${{ runner.os }}-${{ matrix.environment}}-${{ hashFiles('platformio.ini') }} - uses: actions/setup-python@v4 with: python-version: '3.9'