Skip to content

Commit 3062a86

Browse files
committed
ci: create workflow which populates github actions cache
1 parent e0abc0c commit 3062a86

File tree

1 file changed

+44
-0
lines changed

1 file changed

+44
-0
lines changed

.github/workflows/cache.yml

+44
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: Cache
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
- pre-release-testing-branch
8+
- changeset-release/main
9+
- v-next
10+
paths:
11+
- ".github/workflows/populate-cache.yml"
12+
- "**/pnpm-lock.yaml"
13+
pull_request:
14+
paths:
15+
- ".github/workflows/populate-cache.yml"
16+
- "**/pnpm-lock.yaml"
17+
workflow_dispatch:
18+
19+
concurrency:
20+
group: ${{github.workflow}}-${{github.ref}}
21+
cancel-in-progress: true
22+
23+
jobs:
24+
cache:
25+
name: Cache
26+
runs-on: ${{ matrix.runner }}
27+
strategy:
28+
fail-fast: false
29+
matrix:
30+
runner: ["ubuntu-latest", "macos-latest", "windows-latest"]
31+
steps:
32+
- uses: actions/checkout@v4
33+
- id: env
34+
uses: ./.github/actions/setup-env
35+
with:
36+
cache-save: true
37+
- name: Install
38+
if: steps.env.outputs.cache-hit != 'true'
39+
run: |
40+
for lockfile in $(find "$(pwd)" -name pnpm-lock.yaml); do
41+
pushd "$(dirname "$lockfile")"
42+
pnpm install --frozen-lockfile --prefer-offline
43+
popd
44+
done

0 commit comments

Comments
 (0)