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@gmail.com>
This commit is contained in:
parent
55c32a6ce3
commit
895f38ca1e
1 changed files with 5 additions and 3 deletions
8
.github/workflows/build.yml
vendored
8
.github/workflows/build.yml
vendored
|
@ -189,6 +189,8 @@ jobs:
|
||||||
TOOLCHAIN_SHA256=$(echo "$TOOLCHAIN_STRING" | cut -d ' ' -f 1)
|
TOOLCHAIN_SHA256=$(echo "$TOOLCHAIN_STRING" | cut -d ' ' -f 1)
|
||||||
|
|
||||||
echo "toolchain-type=external_sdk" >> $GITHUB_OUTPUT
|
echo "toolchain-type=external_sdk" >> $GITHUB_OUTPUT
|
||||||
|
else
|
||||||
|
echo "toolchain-type=internal" >> $GITHUB_OUTPUT
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "TOOLCHAIN_FILE=$TOOLCHAIN_FILE" >> "$GITHUB_ENV"
|
echo "TOOLCHAIN_FILE=$TOOLCHAIN_FILE" >> "$GITHUB_ENV"
|
||||||
|
@ -196,7 +198,7 @@ jobs:
|
||||||
echo "TOOLCHAIN_PATH=$TOOLCHAIN_PATH" >> "$GITHUB_ENV"
|
echo "TOOLCHAIN_PATH=$TOOLCHAIN_PATH" >> "$GITHUB_ENV"
|
||||||
|
|
||||||
- name: Cache external toolchain/sdk
|
- 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
|
id: cache-external-toolchain
|
||||||
uses: actions/cache@v3
|
uses: actions/cache@v3
|
||||||
with:
|
with:
|
||||||
|
@ -212,7 +214,7 @@ jobs:
|
||||||
ccache-kernel-${{ env.TARGET }}/${{ env.SUBTARGET }}-
|
ccache-kernel-${{ env.TARGET }}/${{ env.SUBTARGET }}-
|
||||||
|
|
||||||
- name: Download external toolchain/sdk
|
- 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}"
|
shell: su buildbot -c "sh -e {0}"
|
||||||
working-directory: openwrt
|
working-directory: openwrt
|
||||||
run: |
|
run: |
|
||||||
|
@ -311,7 +313,7 @@ jobs:
|
||||||
--config ${{ env.TARGET }}/${{ env.SUBTARGET }}
|
--config ${{ env.TARGET }}/${{ env.SUBTARGET }}
|
||||||
|
|
||||||
- name: Configure internal toolchain
|
- 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}"
|
shell: su buildbot -c "sh -e {0}"
|
||||||
working-directory: openwrt
|
working-directory: openwrt
|
||||||
run: |
|
run: |
|
||||||
|
|
Loading…
Reference in a new issue