Skip to content

Commit 9616754

Browse files
committed
Revert "chore: drop corepack"
This reverts commit e565e2c.
1 parent e565e2c commit 9616754

File tree

2 files changed

+118
-18
lines changed

2 files changed

+118
-18
lines changed

.github/workflows/ci.yml

Lines changed: 116 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@ name: CI
33
on:
44
push:
55
branches:
6-
- v10
6+
- v9
77
pull_request:
88
branches:
9-
- v10
9+
- v9
1010
permissions:
1111
contents: read
1212
env:
@@ -27,8 +27,8 @@ jobs:
2727
- name: Checkout codes
2828
uses: actions/checkout@v4
2929

30-
- name: Install pnpm
31-
uses: pnpm/action-setup@v4
30+
- name: Enable corepack
31+
run: corepack enable
3232

3333
- name: Setup node
3434
uses: actions/setup-node@v4
@@ -55,8 +55,8 @@ jobs:
5555
- name: Checkout codes
5656
uses: actions/checkout@v4
5757

58-
- name: Install pnpm
59-
uses: pnpm/action-setup@v4
58+
- name: Enable corepack
59+
run: corepack enable
6060

6161
- name: Setup node
6262
uses: actions/setup-node@v4
@@ -70,29 +70,29 @@ jobs:
7070
- name: Build codes
7171
run: |
7272
pnpm build --all -t
73-
npx tsx ./scripts/postprocess.ts
73+
node -r esbuild-register scripts/postprocess.ts
7474
7575
- name: Cache dist
7676
uses: actions/cache@v4
7777
with:
7878
path: packages/*/dist
79-
key: build-vue-i18n-os-${{ matrix.os }}-${{ github.sha }}
79+
key: build-vue-i18n-next-os-${{ matrix.os }}-${{ github.sha }}
8080

8181
test-unit:
8282
name: Unit test
8383
strategy:
8484
matrix:
8585
os: [ubuntu-latest, windows-latest, macos-latest]
86-
node: [18.19, 20, 22]
86+
node: [18.19, 20]
8787

8888
runs-on: ${{ matrix.os }}
8989

9090
steps:
9191
- name: Checkout codes
9292
uses: actions/checkout@v4
9393

94-
- name: Install pnpm
95-
uses: pnpm/action-setup@v4
94+
- name: Enable corepack
95+
run: corepack enable
9696

9797
- name: Setup node
9898
uses: actions/setup-node@v4
@@ -107,6 +107,34 @@ jobs:
107107
run: |
108108
pnpm test:cover
109109
110+
test-type:
111+
name: Type checking
112+
strategy:
113+
matrix:
114+
os: [ubuntu-latest]
115+
node: [18]
116+
117+
runs-on: ${{ matrix.os }}
118+
119+
steps:
120+
- name: Checkout codes
121+
uses: actions/checkout@v4
122+
123+
- name: Enable corepack
124+
run: corepack enable
125+
126+
- name: Setup node
127+
uses: actions/setup-node@v4
128+
with:
129+
node-version: ${{ matrix.node }}
130+
cache: 'pnpm'
131+
132+
- name: Install dependencies
133+
run: pnpm install --no-frozen-lockfile
134+
135+
- name: Run type checking
136+
run: pnpm test:type
137+
110138
test-e2e:
111139
name: E2E test
112140

@@ -116,16 +144,16 @@ jobs:
116144
strategy:
117145
matrix:
118146
os: [ubuntu-latest, windows-latest, macos-latest]
119-
node: [18.19, 20, 22]
147+
node: [18.19, 20]
120148

121149
runs-on: ${{ matrix.os }}
122150

123151
steps:
124152
- name: Checkout codes
125153
uses: actions/checkout@v4
126154

127-
- name: Install pnpm
128-
uses: pnpm/action-setup@v4
155+
- name: Enable corepack
156+
run: corepack enable
129157

130158
- name: Setup node
131159
uses: actions/setup-node@v4
@@ -136,14 +164,86 @@ jobs:
136164
- name: Install dependencies
137165
run: pnpm install --no-frozen-lockfile
138166

167+
# https://github.com/vitejs/vite/blob/main/.github/workflows/ci.yml#L62
168+
# Install playwright's binary under custom directory to cache
169+
- name: Set Playwright path
170+
if: runner.os != 'Windows'
171+
run: echo "PLAYWRIGHT_BROWSERS_PATH=$HOME/.cache/playwright-bin" >> $GITHUB_ENV
172+
- name: Set Playwright path (windows)
173+
if: runner.os == 'Windows'
174+
run: echo "PLAYWRIGHT_BROWSERS_PATH=$HOME\.cache\playwright-bin" >> $env:GITHUB_ENV
175+
176+
- name: Cache Playwright's binary
177+
uses: actions/cache@v4
178+
with:
179+
# Playwright removes unused browsers automatically
180+
# So does not need to add playwright version to key
181+
key: ${{ runner.os }}-playwright-bin-v1
182+
path: ${{ env.PLAYWRIGHT_BROWSERS_PATH }}
183+
139184
- name: Install Playwright
140-
run: pnpm playwright-core install chromium
185+
# does not need to explicitly set chromium after https://github.com/microsoft/playwright/issues/14862 is solved
186+
run: pnpm playwright install chromium
141187

142188
- name: Restore dist cache
143189
uses: actions/cache@v4
144190
with:
145191
path: packages/*/dist
146-
key: build-vue-i18n-os-${{ matrix.os }}-${{ github.sha }}
192+
key: build-vue-i18n-next-os-${{ matrix.os }}-${{ github.sha }}
147193

148194
- name: Run e2e tests
149195
run: pnpm test:e2e
196+
197+
edge-release:
198+
if: |
199+
github.event_name == 'push' &&
200+
!contains(github.event.head_commit.message, '[skip-release]') &&
201+
!contains(github.event.head_commit.message, 'chore') &&
202+
!contains(github.event.head_commit.message, 'docs')
203+
204+
needs:
205+
- lint
206+
- build
207+
- test-unit
208+
- test-type
209+
- test-e2e
210+
211+
strategy:
212+
matrix:
213+
os: [ubuntu-latest]
214+
node: [18]
215+
216+
runs-on: ${{ matrix.os }}
217+
218+
steps:
219+
- name: Checkout codes
220+
uses: actions/checkout@v4
221+
222+
- name: Enable corepack
223+
run: corepack enable
224+
225+
- name: Setup node
226+
uses: actions/setup-node@v4
227+
with:
228+
node-version: ${{ matrix.node }}
229+
cache: 'pnpm'
230+
231+
- name: Install dependencies
232+
run: pnpm install --no-frozen-lockfile
233+
234+
- name: Restore dist cache
235+
uses: actions/cache@v4
236+
with:
237+
path: packages/*/dist
238+
key: build-vue-i18n-next-os-${{ matrix.os }}-${{ github.sha }}
239+
240+
- name: Upload message-compiler dist files (debug)
241+
uses: actions/upload-artifact@v4
242+
with:
243+
name: message-compiler
244+
path: packages/message-compiler/dist
245+
246+
- name: Release edge version
247+
run: ./scripts/release-edge.sh
248+
env:
249+
NPM_AUTH_TOKEN: ${{secrets.NPM_AUTH_TOKEN}}

.github/workflows/release.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ jobs:
2121
with:
2222
ref: ${{ github.head_ref }}
2323

24-
- name: Install pnpm
25-
uses: pnpm/action-setup@v4
24+
- name: Enable corepack
25+
run: corepack enable
2626

2727
- name: Setup Node
2828
uses: actions/setup-node@v4

0 commit comments

Comments
 (0)