6
6
concurrency :
7
7
group : ${{ github.ref }}-writecache
8
8
cancel-in-progress : true
9
- name : Write Cache
9
+ name : Write Hermit Cache
10
10
jobs :
11
- write-os-specific -cache :
11
+ write-hermit -cache :
12
12
strategy :
13
13
matrix :
14
14
runner : [ubuntu-latest, ftl]
15
- name : Write Cache
15
+ name : Write Hermit Cache
16
16
runs-on : ${{ matrix.runner }}
17
17
steps :
18
18
- name : Checkout code
@@ -31,43 +31,86 @@ jobs:
31
31
echo "key=$key" >> "$GITHUB_OUTPUT"
32
32
exists="$(gh api -H "Accept: application/vnd.github+json" -H "X-GitHub-Api-Version: 2022-11-28" "/repos/block/ftl/actions/caches?key=$key" | jq '.actions_caches | length')"
33
33
echo "exists=$exists" >> "$GITHUB_OUTPUT"
34
+ - name : Install Hermit Packages
35
+ if : ${{ steps.hermit-hash.outputs.exists == 0 }}
36
+ run : hermit install
34
37
- name : Save Hermit Cache
35
38
if : ${{ steps.hermit-hash.outputs.exists == 0 }}
36
39
uses : actions/cache/save@5a3ec84eff668545956fd18022155c47e93e2684 # ratchet:actions/cache/save@5a3ec84eff668545956fd18022155c47e93e2684 # v4
37
40
with :
38
41
path : ${{ runner.os == 'macOS' && '~/Library/Caches/hermit/pkg' || '~/.cache/hermit/pkg' }}
39
42
key : ${{ steps.hermit-hash.outputs.key }}
40
- - name : Install Hermit Packages
41
- if : ${{ steps.hermit-hash.outputs.exists == 0 }}
42
- run : hermit install
43
- - name : Rebuild All
44
- run : just build-all
45
- - name : Download Go Dependencies
46
- run : go mod download -x
43
+
44
+ write-pnpm-cache :
45
+ strategy :
46
+ matrix :
47
+ runner : [ubuntu-latest, ftl]
48
+ name : Write PNPM Cache
49
+ runs-on : ${{ matrix.runner }}
50
+ steps :
51
+ - name : Checkout code
52
+ uses : actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # ratchet:actions/checkout@v4
53
+ - name : Init Hermit
54
+ uses :
cashapp/activate-hermit@12a728b03ad41eace0f9abaf98a035e7e8ea2318 # ratchet:cashapp/[email protected]
55
+ - name : Hash PNPM
56
+ id : pnpm-hash
57
+ shell : bash
58
+ env :
59
+ GH_TOKEN : ${{ github.token }}
60
+ run : |
61
+ hash="${{ hashFiles('**/pnpm-lock.yaml') }}"
62
+ echo "hash=$hash" >> "$GITHUB_OUTPUT"
63
+ key="${{ runner.os }}-${{ runner.arch }}-pnpm-${hash}"
64
+ echo "key=$key" >> "$GITHUB_OUTPUT"
65
+ exists="$(gh api -H "Accept: application/vnd.github+json" -H "X-GitHub-Api-Version: 2022-11-28" "/repos/block/ftl/actions/caches?key=$key" | jq '.actions_caches | length')"
66
+ echo "exists=$exists" >> "$GITHUB_OUTPUT"
47
67
- name : Download pnpm dependencies
68
+ if : ${{ steps.pnpm-hash.outputs.exists == 0 }}
48
69
run : pnpm install
49
- - name : Download playwright browsers
50
- run : npx playwright install
51
- - id : find-go-build-cache
52
- shell : bash
53
- run : echo "cache=$(go env GOCACHE)" >> "$GITHUB_OUTPUT"
54
70
- name : Save pnpm Modules Cache
55
- id : cache- pnpm
71
+ if : ${{ steps. pnpm-hash.outputs.exists == 0 }}
56
72
uses : actions/cache/save@5a3ec84eff668545956fd18022155c47e93e2684 # ratchet:actions/cache/save@5a3ec84eff668545956fd18022155c47e93e2684 # v4
57
73
with :
58
74
path : |
59
75
~/.pnpm-store
60
76
node_modules
61
- key : ${{ runner.os }}-${{ runner.arch }}-pnpm-${{ hashFiles('**/pnpm-lock.yaml') }}
77
+ key : ${{ steps.pnpm-hash.outputs.key }}
78
+
79
+ write-playright-cache :
80
+ strategy :
81
+ matrix :
82
+ runner : [ubuntu-latest, ftl]
83
+ name : Write Playwright Cache
84
+ runs-on : ${{ matrix.runner }}
85
+ steps :
86
+ - name : Checkout code
87
+ uses : actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # ratchet:actions/checkout@v4
88
+ - name : Init Hermit
89
+ uses :
cashapp/activate-hermit@12a728b03ad41eace0f9abaf98a035e7e8ea2318 # ratchet:cashapp/[email protected]
90
+ - name : Hash Playwright
91
+ id : playwright-hash
92
+ shell : bash
93
+ env :
94
+ GH_TOKEN : ${{ github.token }}
95
+ run : |
96
+ hash="${{ hashFiles('**/pnpm-lock.yaml') }}"
97
+ echo "hash=$hash" >> "$GITHUB_OUTPUT"
98
+ key="${{ runner.os }}-${{ runner.arch }}-playwright-${hash}"
99
+ echo "key=$key" >> "$GITHUB_OUTPUT"
100
+ exists="$(gh api -H "Accept: application/vnd.github+json" -H "X-GitHub-Api-Version: 2022-11-28" "/repos/block/ftl/actions/caches?key=$key" | jq '.actions_caches | length')"
101
+ echo "exists=$exists" >> "$GITHUB_OUTPUT"
102
+ - name : Download playwright browsers
103
+ if : ${{ steps.playwright-hash.outputs.exists == 0 }}
104
+ run : npx playwright install
62
105
- name : Save Playwright Browser Cache
63
- id : cache- playwright
106
+ if : ${{ steps. playwright-hash.outputs.exists == 0 }}
64
107
uses : actions/cache/save@5a3ec84eff668545956fd18022155c47e93e2684 # ratchet:actions/cache/save@5a3ec84eff668545956fd18022155c47e93e2684 # v4
65
108
with :
66
109
path : ~/.cache/ms-playwright
67
- key : ${{ runner.os }}-${{ runner.arch }}- playwright-${{ hashFiles('**/pnpm-lock.yaml') }}
110
+ key : ${{ steps. playwright-hash.outputs.key }}
68
111
69
- write-cache :
70
- name : Write Cache
112
+ write-go-maven- cache :
113
+ name : Write Go+Maven Cache
71
114
runs-on : ubuntu-latest
72
115
steps :
73
116
- name : Checkout code
@@ -83,11 +126,6 @@ jobs:
83
126
- id : find-go-build-cache
84
127
shell : bash
85
128
run : echo "cache=$(go env GOCACHE)" >> "$GITHUB_OUTPUT"
86
- - id : hermit-hash
87
- shell : bash
88
- run : |
89
- hash="$(find ./bin ! -type d | sort | xargs openssl sha256 | openssl sha256 -r | cut -d' ' -f1)"
90
- echo "hash=$hash" >> "$GITHUB_OUTPUT"
91
129
- name : Save Go Module Cache
92
130
uses : actions/cache/save@5a3ec84eff668545956fd18022155c47e93e2684 # ratchet:actions/cache/save@5a3ec84eff668545956fd18022155c47e93e2684 # v4
93
131
with :
0 commit comments