Skip to content

Commit

Permalink
ci(cache): improve caching in example workflow
Browse files Browse the repository at this point in the history
- we can skip cache upload when cache already exists

Signed-off-by: AtomicFS <[email protected]>
  • Loading branch information
AtomicFS committed Oct 18, 2024
1 parent adc879a commit 9e8e6d9
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions .github/workflows/example.yml
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ jobs:
git clone --branch "${{ matrix.coreboot-version }}" --depth 1 https://review.coreboot.org/coreboot my_super_dooper_awesome_coreboot
- name: Store coreboot repo in cache
uses: actions/cache/save@v4
if: steps.cache-repo.outputs.cache-hit != 'true'
with:
path: ./my_super_dooper_awesome_coreboot
key: coreboot-${{ matrix.coreboot-version }}
Expand Down Expand Up @@ -162,6 +163,7 @@ jobs:
fetch-depth: 0

- name: Restore cached linux source
id: cache-repo
uses: actions/cache/restore@v4
with:
path: ./linux-${{ matrix.linux-version }}.tar.xz
Expand All @@ -181,6 +183,7 @@ jobs:
LINUX_MAJOR_VERSION: 6
- name: Store linux source in cache
uses: actions/cache/save@v4
if: steps.cache-repo.outputs.cache-hit != 'true'
with:
path: ./linux-${{ matrix.linux-version }}.tar.xz
key: linux-${{ matrix.linux-version }}
Expand Down Expand Up @@ -241,6 +244,7 @@ jobs:
echo "-D BOOTLOADER=COREBOOT -D TPM_ENABLE=TRUE -D NETWORK_IPXE=TRUE" > "edk2_config.cfg"
- name: Store edk2 repo in cache
uses: actions/cache/save@v4
if: steps.cache-repo.outputs.cache-hit != 'true'
with:
path: ./Edk2
key: edk2-${{ matrix.edk2-version }}
Expand Down Expand Up @@ -312,6 +316,7 @@ jobs:
git clone --depth 1 https://review.coreboot.org/blobs stitch
- name: Store coreboot-blobs repo in cache
uses: actions/cache/save@v4
if: steps.cache-repo.outputs.cache-hit != 'true'
with:
path: ./stitch
key: coreboot-blobs-${{ matrix.coreboot-version }}
Expand Down Expand Up @@ -365,6 +370,7 @@ jobs:
git clone --depth 1 --branch v${{ matrix.uroot-version }} https://github.com/u-root/u-root.git || true
- name: Store u-root repo in cache
uses: actions/cache/save@v4
if: steps.cache-repo.outputs.cache-hit != 'true'
with:
path: ./u-root
key: u-root-${{ matrix.uroot-version }}
Expand Down Expand Up @@ -418,6 +424,7 @@ jobs:
git clone --depth 1 --branch v${{ matrix.uroot-version }} https://github.com/u-root/u-root.git
- name: Store u-root repo in cache
uses: actions/cache/save@v4
if: steps.cache-repo.outputs.cache-hit != 'true'
with:
path: ./u-root
key: u-root-${{ matrix.uroot-version }}
Expand Down

0 comments on commit 9e8e6d9

Please sign in to comment.