Skip to content

Commit a7d11f8

Browse files
committed
ci: pass the whole key instead of trying to reconstruct it
1 parent fa0dc5e commit a7d11f8

File tree

3 files changed

+29
-14
lines changed

3 files changed

+29
-14
lines changed

.github/workflows/build-depends.yml

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,10 @@ on:
1515
description: "Target triplet"
1616
required: true
1717
type: string
18+
outputs:
19+
key:
20+
description: "Key needed for restoring depends cache"
21+
value: ${{ jobs.build-depends.restore.outputs.cache-primary-key }}
1822

1923
jobs:
2024
build-depends:
@@ -39,8 +43,9 @@ jobs:
3943
depends-sources-${{ hashFiles('depends/packages/*') }}
4044
depends-sources-
4145
42-
- name: Cache depends
43-
uses: actions/cache@v4
46+
- name: Restore cached depends
47+
uses: actions/cache/restore@v4
48+
id: restore
4449
with:
4550
path: |
4651
depends/built
@@ -52,3 +57,12 @@ jobs:
5257
5358
- name: Build depends
5459
run: env HOST=${{ inputs.host }} make -j$(nproc) -C depends
60+
61+
- name: Save depends cache
62+
uses: actions/cache/save@v4
63+
if: steps.restore.outputs.cache-hit != 'true'
64+
with:
65+
path: |
66+
depends/built
67+
depends/${{ inputs.host }}
68+
key: ${{ steps.restore.outputs.cache-primary-key }}

.github/workflows/build-src.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ on:
1111
description: "Path to built container at registry"
1212
required: true
1313
type: string
14-
depends-target:
15-
description: "Target name of depends as defined by inputs.sh"
14+
depends-key:
15+
description: "Key needed to access cached depends"
1616
required: true
1717
type: string
1818
host:
@@ -40,7 +40,8 @@ jobs:
4040
path: |
4141
depends/built
4242
depends/${{ inputs.host }}
43-
key: ${{ runner.os }}-depends-${{ inputs.depends-target }}-${{ hashFiles('depends/packages/*') }}
43+
key: ${{ inputs.depends-key }}
44+
fail-on-cache-miss: true
4445

4546
- name: Determine PR Base SHA
4647
id: vars

.github/workflows/build.yml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ jobs:
5151
with:
5252
build-target: arm-linux
5353
container-path: ${{ needs.container.outputs.path }}
54-
depends-target: arm-linux
54+
depends-key: ${{ needs.depends-arm-linux.outputs.key }}
5555
host: arm-linux-gnueabihf
5656

5757
src-linux64:
@@ -61,7 +61,7 @@ jobs:
6161
with:
6262
build-target: linux64
6363
container-path: ${{ needs.container.outputs.path }}
64-
depends-target: linux64
64+
depends-key: ${{ needs.depends-linux64.outputs.key }}
6565
host: x86_64-pc-linux-gnu
6666

6767
src-linux64_cxx20:
@@ -71,7 +71,7 @@ jobs:
7171
with:
7272
build-target: linux64_cxx20
7373
container-path: ${{ needs.container.outputs.path }}
74-
depends-target: linux64
74+
depends-key: ${{ needs.depends-linux64.outputs.key }}
7575
host: x86_64-pc-linux-gnu
7676

7777
src-linux64_fuzz:
@@ -81,7 +81,7 @@ jobs:
8181
with:
8282
build-target: linux64_fuzz
8383
container-path: ${{ needs.container.outputs.path }}
84-
depends-target: linux64
84+
depends-key: ${{ needs.depends-linux64.outputs.key }}
8585
host: x86_64-pc-linux-gnu
8686

8787
src-linux64_nowallet:
@@ -91,7 +91,7 @@ jobs:
9191
with:
9292
build-target: linux64_nowallet
9393
container-path: ${{ needs.container.outputs.path }}
94-
depends-target: linux64
94+
depends-key: ${{ needs.depends-linux64.outputs.key }}
9595
host: x86_64-pc-linux-gnu
9696

9797
src-linux64_sqlite:
@@ -101,7 +101,7 @@ jobs:
101101
with:
102102
build-target: linux64_sqlite
103103
container-path: ${{ needs.container.outputs.path }}
104-
depends-target: linux64
104+
depends-key: ${{ needs.depends-linux64.outputs.key }}
105105
host: x86_64-pc-linux-gnu
106106

107107
src-linux64_tsan:
@@ -111,7 +111,7 @@ jobs:
111111
with:
112112
build-target: linux64_tsan
113113
container-path: ${{ needs.container.outputs.path }}
114-
depends-target: linux64
114+
depends-key: ${{ needs.depends-linux64.outputs.key }}
115115
host: x86_64-pc-linux-gnu
116116

117117
src-linux64_ubsan:
@@ -121,7 +121,7 @@ jobs:
121121
with:
122122
build-target: linux64_ubsan
123123
container-path: ${{ needs.container.outputs.path }}
124-
depends-target: linux64
124+
depends-key: ${{ needs.depends-linux64.outputs.key }}
125125
host: x86_64-pc-linux-gnu
126126

127127
src-win64:
@@ -131,5 +131,5 @@ jobs:
131131
with:
132132
build-target: win64
133133
container-path: ${{ needs.container.outputs.path }}
134-
depends-target: win64
134+
depends-key: ${{ needs.depends-win64.outputs.key }}
135135
host: x86_64-w64-mingw32

0 commit comments

Comments
 (0)