Skip to content

Commit

Permalink
[github-actions] delay restoring from lfs cache in docker/build job
Browse files Browse the repository at this point in the history
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
  • Loading branch information
lmnotran committed Feb 7, 2024
1 parent c4cee1c commit f4bb727
Showing 1 changed file with 15 additions and 15 deletions.
30 changes: 15 additions & 15 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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

Expand All @@ -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
Expand Down

0 comments on commit f4bb727

Please sign in to comment.