Skip to content

Commit

Permalink
CI: kernel: Cache external toolchain
Browse files Browse the repository at this point in the history
Cache external toolchain for each target to remove load from openwrt cdn
server and make the external toolchain setup quicker.

Signed-off-by: Christian Marangi <[email protected]>
  • Loading branch information
Ansuel committed Sep 10, 2022
1 parent a34cd4f commit f522c27
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions .github/workflows/kernel.yml
Original file line number Diff line number Diff line change
Expand Up @@ -102,12 +102,23 @@ jobs:
- name: Parse toolchain file
working-directory: openwrt
run: |
TOOLCHAIN_FILE=$(curl "https://downloads.cdn.openwrt.org/snapshots/targets/${{ env.TARGET }}/${{ env.SUBTARGET }}/sha256sums" \
| sed -n -e 's/.*\(openwrt-toolchain.*\).tar.xz/\1/p')
TOOLCHAIN_STRING="$(curl "https://downloads.cdn.openwrt.org/snapshots/targets/${{ env.TARGET }}/${{ env.SUBTARGET }}/sha256sums" \
| grep ".*openwrt-toolchain.*tar.xz")"
TOOLCHAIN_FILE=$(echo "$TOOLCHAIN_STRING" | sed -n -e 's/.*\(openwrt-toolchain.*\).tar.xz/\1/p')
TOOLCHAIN_SHA256=$(echo "$TOOLCHAIN_STRING" | cut -d ' ' -f 1)
echo "TOOLCHAIN_FILE=$TOOLCHAIN_FILE" >> "$GITHUB_ENV"
echo "TOOLCHAIN_SHA256=$TOOLCHAIN_SHA256" >> "$GITHUB_ENV"
- name: Cache external toolchain
id: cache-external-toolchain
uses: actions/cache@v3
with:
path: openwrt/${{ env.TOOLCHAIN_FILE }}
key: ${{ env.TOOLCHAIN_FILE }}-${{ env.TOOLCHAIN_SHA256 }}

- name: Download external toolchain
if: ${{ steps.cache-external-toolchain.outputs.cache-hit != 'true' }}
shell: su buildbot -c "sh -e {0}"
working-directory: openwrt
run: |
Expand Down

0 comments on commit f522c27

Please sign in to comment.