-
Notifications
You must be signed in to change notification settings - Fork 61
117 lines (99 loc) · 3.8 KB
/
Copy pathwarm-caches.yml
File metadata and controls
117 lines (99 loc) · 3.8 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
name: Warm caches
# GitHub only shares caches saved on main with other branches, and the PR
# workflows never run on main. This job seeds the caches they restore.
on:
push:
branches: [main]
workflow_dispatch:
concurrency:
group: warm-caches-${{ github.ref }}
cancel-in-progress: true
jobs:
linux:
runs-on: ubuntu-latest
timeout-minutes: 15
permissions:
contents: read
steps:
- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- name: Setup pnpm
uses: pnpm/action-setup@0ebf47130e4866e96fce0953f49152a61190b271 # v6.0.9
- name: Setup Node.js
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
with:
node-version: 22
cache: "pnpm"
# No restore-keys: a fresh save per commit keeps the cache from growing
# forever, at the cost of a cold build on every main push.
- name: Cache turbo artifacts
uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
with:
path: .turbo/cache
key: turbo-${{ github.sha }}
# Same key as code-storybook.yml's storybook job.
- name: Cache Playwright browsers
id: playwright-cache
uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
with:
path: ~/.cache/ms-playwright
key: playwright-chromium-${{ runner.os }}-${{ hashFiles('pnpm-lock.yaml') }}
- name: Install dependencies
run: pnpm install --frozen-lockfile
env:
SKIP_ELECTRON_REBUILD: "1"
- name: Seed turbo cache (build + typecheck)
run: |
pnpm run build:deps
pnpm run typecheck
- name: Install Playwright Chromium
if: steps.playwright-cache.outputs.cache-hit != 'true'
working-directory: apps/code
run: pnpm exec playwright install chromium
macos:
runs-on: macos-latest
timeout-minutes: 30
permissions:
contents: read
steps:
- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- name: Setup pnpm
uses: pnpm/action-setup@0ebf47130e4866e96fce0953f49152a61190b271 # v6.0.9
- name: Setup Node.js
id: node
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
with:
node-version: 22
cache: "pnpm"
# Same keys as test.yml's integration-test job.
- name: Cache Electron binary
id: electron-cache
uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
with:
path: ~/Library/Caches/electron
key: electron-${{ runner.os }}-${{ hashFiles('pnpm-lock.yaml') }}
- name: Cache Playwright browsers
id: playwright-cache
uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
with:
path: ~/Library/Caches/ms-playwright
key: playwright-${{ runner.os }}-${{ hashFiles('pnpm-lock.yaml') }}
# macOS minutes are 10x; do nothing when every cache is already warm.
- name: Install dependencies
if: >-
steps.node.outputs.cache-hit != 'true' ||
steps.electron-cache.outputs.cache-hit != 'true' ||
steps.playwright-cache.outputs.cache-hit != 'true'
# Electron's own postinstall fills ~/Library/Caches/electron; the sqlite
# rebuild only touches node_modules, which is not cached, so skip it.
run: pnpm install --frozen-lockfile
env:
SKIP_ELECTRON_REBUILD: "1"
- name: Install Playwright Chromium
if: steps.playwright-cache.outputs.cache-hit != 'true'
run: pnpm --filter code exec playwright install chromium