From b4d1cd0348d27af6c1ace04bea4d65d5355a30d5 Mon Sep 17 00:00:00 2001 From: Nick Chan Date: Tue, 24 Jan 2023 15:16:50 +0800 Subject: [PATCH] cache toolchain --- .github/workflows/build.yml | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 03059ef..a231319 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -73,13 +73,26 @@ jobs: sudo apt install -y pkg-config autoconf automake sudo pip3 install jsonschema jinja2 + - name: Download toolchain checksum + run: | + curl -LO https://musl.cc/SHA512SUMS + echo "TOOLCHAIN_CHECKSUM="$(grep ${{ matrix.triple }}-cross.tgz SHA512SUMS | cut -d' ' -f1) >> $GITHUB_ENV + + - name: Download toolchain (cached) + id: toolchain_cache + uses: actions/cache@v3 + with: + path: ${{ matrix.triple }}-cross.tgz + key: ${{ matrix.triple }}-${{ env.TOOLCHAIN_CHECKSUM }}-toolchain + - name: Download toolchain + if: steps.toolchain_cache.outputs.cache-hit != 'true' run: | curl -LO https://musl.cc/${{ matrix.triple }}-cross.tgz - tar -xf ${{ matrix.triple }}-cross.tgz - name: Setup environment run: | + tar -xf ${{ matrix.triple }}-cross.tgz mkdir sysroot echo "$(pwd)/${{ matrix.triple }}-cross/bin" >> $GITHUB_PATH case ${{ matrix.triple }} in