From d444ac8f4856656aafdf6e7d70439c733288ec2d Mon Sep 17 00:00:00 2001 From: Mason Tran Date: Thu, 30 May 2024 15:30:11 -0400 Subject: [PATCH] [github-actions] cache ARM Toolchain between builds --- .github/workflows/build.yml | 39 ++++++++++++++++++++++--------------- 1 file changed, 23 insertions(+), 16 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index f27e4a02..024785fb 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -78,23 +78,15 @@ jobs: key: ${{ matrix.gcc_ver }} verbose: 2 - - name: Append LFS include config to GSDK .lfsconfig - run: | - git -C third_party/silabs/gecko_sdk checkout -- .lfsconfig - echo 'fetchinclude = "platform/emdrv/nvm3/lib/libnvm3_*_gcc.a,platform/radio/rail_lib/autogen/librail_release/librail_config_mgm*_gcc.a,platform/radio/rail_lib/autogen/librail_release/*efr32xg*_gcc_release.a"' >> third_party/silabs/gecko_sdk/.lfsconfig - - - name: Create LFS file hash list - run: git -C third_party/silabs/gecko_sdk lfs ls-files -l | cut -d' ' -f1 | sort > .lfs-assets-id - - - name: Restore gecko_sdk LFS cache + - name: Restore ARM Toolchain uses: actions/cache@v4 - id: lfs-cache + id: cache-arm-toolchain with: - path: .git/modules/third_party/silabs/gecko_sdk/lfs - key: lfs-${{ hashFiles('.lfs-assets-id') }} + path: ${{ env.TOOLCHAIN_DIR }}/${{ matrix.gcc_extract_dir }} + key: ${{ matrix.gcc_extract_dir }} - - name: Git LFS Pull - run: git -C third_party/silabs/gecko_sdk lfs pull + - name: Bootstrap ARM Toolchain + run: script/bootstrap arm_toolchain ${{ matrix.gcc_download_url }} ${{ matrix.gcc_extract_dir }} ${{ env.TOOLCHAIN_DIR }} - name: Download Docker image uses: actions/download-artifact@v4 @@ -114,8 +106,23 @@ jobs: -v $PWD:/ot-efr32 -w /ot-efr32\ ${{ env.DOCKER_IMAGE_SHA_TAG }} - - name: Bootstrap ARM Toolchain - run: docker exec ot-efr32-dev script/bootstrap arm_toolchain ${{ matrix.gcc_download_url }} ${{ matrix.gcc_extract_dir }} ${{ env.TOOLCHAIN_DIR }} + - name: Append LFS include config to GSDK .lfsconfig + run: | + git -C third_party/silabs/gecko_sdk checkout -- .lfsconfig + echo 'fetchinclude = "platform/emdrv/nvm3/lib/libnvm3_*_gcc.a,platform/radio/rail_lib/autogen/librail_release/librail_config_mgm*_gcc.a,platform/radio/rail_lib/autogen/librail_release/*efr32xg*_gcc_release.a"' >> third_party/silabs/gecko_sdk/.lfsconfig + + - name: Create LFS file hash list + run: git -C third_party/silabs/gecko_sdk lfs ls-files -l | cut -d' ' -f1 | sort > .lfs-assets-id + + - name: Restore gecko_sdk LFS cache + uses: actions/cache@v4 + id: lfs-cache-gecko_gsdk + with: + path: .git/modules/third_party/silabs/gecko_sdk/lfs + key: lfs-${{ hashFiles('.lfs-assets-id') }} + + - name: Git LFS Pull + run: git -C third_party/silabs/gecko_sdk lfs pull - name: Build run: docker exec ot-efr32-dev bash -c 'PATH=${{ env.TOOLCHAIN_DIR }}/${{ matrix.gcc_extract_dir }}/bin:$PATH script/test'