@@ -3,12 +3,12 @@ name: CI
33on :
44 push :
55 paths-ignore :
6- - ' docs/**'
6+ - " docs/**"
77 branches :
88 - main
99 pull_request :
1010 paths-ignore :
11- - ' docs/**'
11+ - " docs/**"
1212 branches :
1313 - main
1414
@@ -25,16 +25,17 @@ jobs:
2525
2626 steps :
2727 - uses : actions/checkout@v3
28+ - run : corepack enable
2829 - uses : actions/setup-node@v3
2930 with :
3031 node-version : ${{ matrix.node }}
31- cache : ' yarn '
32+ cache : " pnpm "
3233
3334 - name : Install dependencies
34- run : yarn --immutable
35+ run : pnpm install
3536
3637 - name : Build
37- run : yarn build
38+ run : pnpm build
3839
3940 - name : Cache dist
4041 uses : actions/cache@v3
@@ -54,16 +55,17 @@ jobs:
5455
5556 steps :
5657 - uses : actions/checkout@v3
58+ - run : corepack enable
5759 - uses : actions/setup-node@v3
5860 with :
5961 node-version : ${{ matrix.node }}
60- cache : ' yarn '
62+ cache : " pnpm "
6163
6264 - name : Install dependencies
63- run : yarn --immutable
65+ run : pnpm install
6466
6567 - name : Lint
66- run : yarn lint
68+ run : pnpm lint
6769
6870 typecheck :
6971 runs-on : ${{ matrix.os }}
@@ -77,19 +79,20 @@ jobs:
7779
7880 steps :
7981 - uses : actions/checkout@v3
82+ - run : corepack enable
8083 - uses : actions/setup-node@v3
8184 with :
8285 node-version : ${{ matrix.node }}
83- cache : ' yarn '
86+ cache : " pnpm "
8487
8588 - name : Install dependencies
86- run : yarn --immutable
89+ run : pnpm install
8790
88- - name : Stub
89- run : yarn stub
91+ - name : Build (stub)
92+ run : pnpm build: stub
9093
9194 - name : Typecheck
92- run : yarn typecheck
95+ run : pnpm typecheck
9396
9497 test-fixtures :
9598 runs-on : ${{ matrix.os }}
@@ -103,25 +106,47 @@ jobs:
103106
104107 steps :
105108 - uses : actions/checkout@v3
109+ - run : corepack enable
106110 - uses : actions/setup-node@v3
107111 with :
108112 node-version : ${{ matrix.node }}
109- cache : ' yarn '
113+ cache : " pnpm "
110114
111115 - name : Install dependencies
112- run : yarn --immutable
116+ run : pnpm install
117+
118+ # https://github.com/vitejs/vite/blob/main/.github/workflows/ci.yml#L62
119+ # Install playwright's binary under custom directory to cache
120+ - name : Set Playwright path
121+ if : runner.os != 'Windows'
122+ run : echo "PLAYWRIGHT_BROWSERS_PATH=$HOME/.cache/playwright-bin" >> $GITHUB_ENV
123+ - name : Set Playwright path (windows)
124+ if : runner.os == 'Windows'
125+ run : echo "PLAYWRIGHT_BROWSERS_PATH=$HOME\.cache\playwright-bin" >> $env:GITHUB_ENV
126+
127+ - name : Cache Playwright's binary
128+ uses : actions/cache@v3
129+ with :
130+ # Playwright removes unused browsers automatically
131+ # So does not need to add playwright version to key
132+ key : ${{ runner.os }}-playwright-bin-v1
133+ path : ${{ env.PLAYWRIGHT_BROWSERS_PATH }}
134+
135+ - name : Install Playwright
136+ # does not need to explicitly set chromium after https://github.com/microsoft/playwright/issues/14862 is solved
137+ run : pnpm playwright install chromium
113138
114- - name : Stub
115- run : yarn stub
139+ - name : Build (stub)
140+ run : pnpm build: stub
116141
117142 - name : Test (unit)
118- run : yarn test:unit
143+ run : pnpm test:unit
119144
120145 - name : Test (fixtures)
121- run : yarn test:fixtures
146+ run : pnpm test:fixtures
122147
123148 - name : Test (fixtures with dev)
124- run : yarn test:fixtures:dev
149+ run : pnpm test:fixtures:dev
125150 env :
126151 NODE_OPTIONS : --max-old-space-size=8192
127152
@@ -137,19 +162,41 @@ jobs:
137162
138163 steps :
139164 - uses : actions/checkout@v3
165+ - run : corepack enable
140166 - uses : actions/setup-node@v3
141167 with :
142168 node-version : ${{ matrix.node }}
143- cache : ' yarn '
169+ cache : " pnpm "
144170
145171 - name : Install dependencies
146- run : yarn --immutable
172+ run : pnpm install
173+
174+ # https://github.com/vitejs/vite/blob/main/.github/workflows/ci.yml#L62
175+ # Install playwright's binary under custom directory to cache
176+ - name : Set Playwright path (non-windows)
177+ if : runner.os != 'Windows'
178+ run : echo "PLAYWRIGHT_BROWSERS_PATH=$HOME/.cache/playwright-bin" >> $GITHUB_ENV
179+ - name : Set Playwright path (windows)
180+ if : runner.os == 'Windows'
181+ run : echo "PLAYWRIGHT_BROWSERS_PATH=$HOME\.cache\playwright-bin" >> $env:GITHUB_ENV
182+
183+ - name : Cache Playwright's binary
184+ uses : actions/cache@v3
185+ with :
186+ # Playwright removes unused browsers automatically
187+ # So does not need to add playwright version to key
188+ key : ${{ runner.os }}-playwright-bin-v1
189+ path : ${{ env.PLAYWRIGHT_BROWSERS_PATH }}
190+
191+ - name : Install Playwright
192+ # does not need to explicitly set chromium after https://github.com/microsoft/playwright/issues/14862 is solved
193+ run : pnpm playwright install chromium
147194
148- - name : Stub
149- run : yarn stub
195+ - name : Build (stub)
196+ run : pnpm build: stub
150197
151198 - name : Test (fixtures)
152- run : yarn test:fixtures:webpack
199+ run : pnpm test:fixtures:webpack
153200
154201 test-types :
155202 needs :
@@ -165,13 +212,14 @@ jobs:
165212
166213 steps :
167214 - uses : actions/checkout@v3
215+ - run : corepack enable
168216 - uses : actions/setup-node@v3
169217 with :
170218 node-version : ${{ matrix.node }}
171- cache : ' yarn '
219+ cache : " pnpm "
172220
173221 - name : Install dependencies
174- run : yarn --immutable
222+ run : pnpm install
175223
176224 - name : Restore dist cache
177225 uses : actions/cache@v3
@@ -180,7 +228,7 @@ jobs:
180228 key : ${{ matrix.os }}-node-v${{ matrix.node }}-${{ github.sha }}
181229
182230 - name : Test (types)
183- run : yarn test:types
231+ run : pnpm test:types
184232
185233 build-release :
186234 if : |
@@ -205,13 +253,14 @@ jobs:
205253
206254 steps :
207255 - uses : actions/checkout@v3
256+ - run : corepack enable
208257 - uses : actions/setup-node@v3
209258 with :
210259 node-version : ${{ matrix.node }}
211- cache : ' yarn '
260+ cache : " pnpm "
212261
213262 - name : Install dependencies
214- run : yarn --immutable
263+ run : pnpm install
215264
216265 - name : Restore dist cache
217266 uses : actions/cache@v3
0 commit comments