Skip to content

Commit

Permalink
ci: pass the whole key instead of trying to reconstruct it
Browse files Browse the repository at this point in the history
  • Loading branch information
kwvg committed Feb 10, 2025
1 parent 374e980 commit 1a67a02
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 13 deletions.
18 changes: 16 additions & 2 deletions .github/workflows/build-depends.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ on:
description: "Target triplet"
required: true
type: string
outputs:
key:
description: "Key needed for restoring depends cache"
value: ${{ jobs.build-depends.restore.outputs.cache-primary-key }}

jobs:
build-depends:
Expand All @@ -39,8 +43,9 @@ jobs:
depends-sources-${{ hashFiles('depends/packages/*') }}
depends-sources-
- name: Cache depends
uses: actions/cache@v4
- name: Restore cached depends
uses: actions/cache/restore@v4
id: restore
with:
path: |
depends/built
Expand All @@ -52,3 +57,12 @@ jobs:
- name: Build depends
run: env HOST=${{ inputs.host }} make -j$(nproc) -C depends

- name: Save depends cache
uses: actions/cache/save@v4
if: steps.restore.outputs.cache-hit != 'true'
with:
path: |
depends/built
depends/${{ inputs.host }}
key: ${{ steps.restore.outputs.cache-primary-key }}
7 changes: 4 additions & 3 deletions .github/workflows/build-src.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ on:
description: "Path to built container at registry"
required: true
type: string
depends-target:
description: "Target name of depends as defined by inputs.sh"
depends-key:
description: "Key needed to access cached depends"
required: true
type: string
host:
Expand Down Expand Up @@ -40,7 +40,8 @@ jobs:
path: |
depends/built
depends/${{ inputs.host }}
key: ${{ runner.os }}-depends-${{ inputs.depends-target }}-${{ hashFiles('depends/packages/*') }}
key: ${{ inputs.depends-key }}
fail-on-cache-miss: true

- name: Determine PR Base SHA
id: vars
Expand Down
16 changes: 8 additions & 8 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ jobs:
with:
build-target: arm-linux
container-path: ${{ needs.container.outputs.path }}
depends-target: arm-linux
depends-key: ${{ needs.depends-arm-linux.outputs.key }}
host: arm-linux-gnueabihf

src-linux64:
Expand All @@ -52,7 +52,7 @@ jobs:
with:
build-target: linux64
container-path: ${{ needs.container.outputs.path }}
depends-target: linux64
depends-key: ${{ needs.depends-linux64.outputs.key }}
host: x86_64-pc-linux-gnu

src-linux64_cxx20:
Expand All @@ -62,7 +62,7 @@ jobs:
with:
build-target: linux64_cxx20
container-path: ${{ needs.container.outputs.path }}
depends-target: linux64
depends-key: ${{ needs.depends-linux64.outputs.key }}
host: x86_64-pc-linux-gnu

src-linux64_fuzz:
Expand All @@ -72,7 +72,7 @@ jobs:
with:
build-target: linux64_fuzz
container-path: ${{ needs.container.outputs.path }}
depends-target: linux64
depends-key: ${{ needs.depends-linux64.outputs.key }}
host: x86_64-pc-linux-gnu

src-linux64_nowallet:
Expand All @@ -82,7 +82,7 @@ jobs:
with:
build-target: linux64_nowallet
container-path: ${{ needs.container.outputs.path }}
depends-target: linux64
depends-key: ${{ needs.depends-linux64.outputs.key }}
host: x86_64-pc-linux-gnu

src-linux64_sqlite:
Expand All @@ -92,7 +92,7 @@ jobs:
with:
build-target: linux64_sqlite
container-path: ${{ needs.container.outputs.path }}
depends-target: linux64
depends-key: ${{ needs.depends-linux64.outputs.key }}
host: x86_64-pc-linux-gnu

src-linux64_tsan:
Expand All @@ -102,7 +102,7 @@ jobs:
with:
build-target: linux64_tsan
container-path: ${{ needs.container.outputs.path }}
depends-target: linux64
depends-key: ${{ needs.depends-linux64.outputs.key }}
host: x86_64-pc-linux-gnu

src-linux64_ubsan:
Expand All @@ -112,5 +112,5 @@ jobs:
with:
build-target: linux64_ubsan
container-path: ${{ needs.container.outputs.path }}
depends-target: linux64
depends-key: ${{ needs.depends-linux64.outputs.key }}
host: x86_64-pc-linux-gnu

0 comments on commit 1a67a02

Please sign in to comment.