[openwrt/openwrt] CI: build: fallback to compile toolchain if external toolchain fail
LEDE Commits
lede-commits at lists.infradead.org
Tue Jan 10 17:04:30 PST 2023
ansuel pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/895f38ca1efeb46f0cd3029c732e6156d4589eb0
commit 895f38ca1efeb46f0cd3029c732e6156d4589eb0
Author: Christian Marangi <ansuelsmth at gmail.com>
AuthorDate: Tue Jan 10 23:51:32 2023 +0100
CI: build: fallback to compile toolchain if external toolchain fail
If for whatever reason external toolchain can't be found or downloaded,
fallback to internal toolchain build.
This can be useful when new target are introduced and external toolchain
are not present in openwrt fileserver.
Signed-off-by: Christian Marangi <ansuelsmth at gmail.com>
---
.github/workflows/build.yml | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
index c892857999..de168c0cb9 100644
--- a/.github/workflows/build.yml
+++ b/.github/workflows/build.yml
@@ -189,6 +189,8 @@ jobs:
TOOLCHAIN_SHA256=$(echo "$TOOLCHAIN_STRING" | cut -d ' ' -f 1)
echo "toolchain-type=external_sdk" >> $GITHUB_OUTPUT
+ else
+ echo "toolchain-type=internal" >> $GITHUB_OUTPUT
fi
echo "TOOLCHAIN_FILE=$TOOLCHAIN_FILE" >> "$GITHUB_ENV"
@@ -196,7 +198,7 @@ jobs:
echo "TOOLCHAIN_PATH=$TOOLCHAIN_PATH" >> "$GITHUB_ENV"
- name: Cache external toolchain/sdk
- if: inputs.build_toolchain == false
+ if: inputs.build_toolchain == false && steps.parse-toolchain.outputs.toolchain-type != 'internal'
id: cache-external-toolchain
uses: actions/cache at v3
with:
@@ -212,7 +214,7 @@ jobs:
ccache-kernel-${{ env.TARGET }}/${{ env.SUBTARGET }}-
- name: Download external toolchain/sdk
- if: inputs.build_toolchain == false && steps.cache-external-toolchain.outputs.cache-hit != 'true'
+ if: inputs.build_toolchain == false && steps.cache-external-toolchain.outputs.cache-hit != 'true' && steps.parse-toolchain.outputs.toolchain-type != 'internal'
shell: su buildbot -c "sh -e {0}"
working-directory: openwrt
run: |
@@ -311,7 +313,7 @@ jobs:
--config ${{ env.TARGET }}/${{ env.SUBTARGET }}
- name: Configure internal toolchain
- if: inputs.build_toolchain == true
+ if: inputs.build_toolchain == true || steps.parse-toolchain.outputs.toolchain-type == 'internal'
shell: su buildbot -c "sh -e {0}"
working-directory: openwrt
run: |
More information about the lede-commits
mailing list