From 361c419e07092d6a68148136bf6b7b23754a11f5 Mon Sep 17 00:00:00 2001 From: Mason Tran Date: Tue, 6 Feb 2024 23:49:13 -0500 Subject: [PATCH] [github-actions] delay restoring from lfs cache in docker/build job LFS files aren't needed for docker image build. This delays restoring the lfs files from cache until they are needed during the testing step --- .github/workflows/docker.yml | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index bb2607c2..8f00ae44 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -49,8 +49,8 @@ permissions: # added using https://github.com/step-security/secure-workflows contents: read jobs: - docker: - name: Build docker image + build: + name: Build Docker Image runs-on: ubuntu-22.04 steps: - name: Harden Runner @@ -62,19 +62,6 @@ jobs: with: submodules: true - - 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 - 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: Set up Docker Buildx uses: docker/setup-buildx-action@f95db51fddba0c2d1ec667646a06c2ce06100226 # v3.0.0 @@ -92,6 +79,19 @@ jobs: cache-from: type=gha cache-to: type=gha,mode=max + - 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 + 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: Test build inside container run: | docker run -v ${{ github.workspace }}:/ot-efr32/ --user $(id -u) --rm ${{ env.TEST_TAG }} script/build --skip-silabs-apps brd4151a