Skip to content

Commit

Permalink
[github-actions] cache ARM Toolchain between builds
Browse files Browse the repository at this point in the history
  • Loading branch information
lmnotran committed Jun 26, 2024
1 parent 40f519c commit d444ac8
Showing 1 changed file with 23 additions and 16 deletions.
39 changes: 23 additions & 16 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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'
Expand Down

0 comments on commit d444ac8

Please sign in to comment.