Skip to content

Commit 850a913

Browse files
committed
ci: improve GitHub Actions workflows
- Add Playwright browser installation with deps - Update action versions consistently (checkout@v5, pnpm/action-setup@v4) - Add corepack enable to all workflows for consistency - Fix prerelease detection to include rc tags - Run tests separately for better visibility - Test on both Node 20 and 22 Authored by: Aaron Lippold<lippold@gmail.com>
1 parent 95239be commit 850a913

File tree

3 files changed

+46
-31
lines changed

3 files changed

+46
-31
lines changed

.github/workflows/ci.yml

Lines changed: 32 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -9,41 +9,52 @@ on:
99
- main
1010

1111
jobs:
12-
lint:
13-
runs-on: ubuntu-latest
12+
ci:
13+
runs-on: ${{ matrix.os }}
14+
15+
strategy:
16+
matrix:
17+
os: [ubuntu-latest]
18+
node: [20, 22]
1419

1520
steps:
1621
- uses: actions/checkout@v5
1722

23+
- run: corepack enable
24+
1825
- uses: actions/setup-node@v4
1926
with:
20-
node-version: 22
21-
22-
- run: corepack enable
27+
node-version: ${{ matrix.node }}
28+
cache: pnpm
2329

2430
- name: Install dependencies
2531
run: pnpm install
2632

27-
- name: Lint
28-
run: pnpm lint
33+
- name: Install Playwright browsers
34+
run: pnpm exec playwright install --with-deps chromium
2935

30-
test:
31-
runs-on: ubuntu-latest
36+
- name: Prepare
37+
run: pnpm dev:prepare
3238

33-
steps:
34-
- uses: actions/checkout@v5
39+
- name: Build module
40+
run: pnpm prepack
3541

36-
- uses: actions/setup-node@v4
37-
with:
38-
node-version: 22
42+
- name: Lint
43+
run: pnpm lint
44+
if: matrix.node == 22
3945

40-
- run: corepack enable
46+
- name: Test types
47+
run: pnpm test:types
4148

42-
- name: Install dependencies
43-
run: pnpm install
49+
- name: Test unit
50+
run: npx vitest run test/unit
4451

45-
- name: Playground prepare
46-
run: pnpm dev:prepare
52+
- name: Test integration
53+
run: npx vitest run test/integration
54+
55+
- name: Test E2E
56+
run: npx vitest run test/e2e
4757

48-
- name: Test
49-
run: pnpm test
58+
- name: Test performance
59+
run: npx vitest run test/performance
60+
if: matrix.node == 22

.github/workflows/docs.yml

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -20,25 +20,27 @@ jobs:
2020
runs-on: ubuntu-latest
2121
steps:
2222
- name: Checkout
23-
uses: actions/checkout@v4
24-
23+
uses: actions/checkout@v5
24+
25+
- run: corepack enable
26+
2527
- name: Setup pnpm
26-
uses: pnpm/action-setup@v2
28+
uses: pnpm/action-setup@v4
2729
with:
2830
version: 9
29-
31+
3032
- name: Setup Node
3133
uses: actions/setup-node@v4
3234
with:
3335
node-version: '22'
34-
cache: 'pnpm'
35-
36+
cache: pnpm
37+
3638
- name: Install dependencies
3739
run: pnpm install
38-
40+
3941
- name: Build documentation
4042
run: GITHUB_DEPLOY=true pnpm docs:build
41-
43+
4244
- name: Upload artifact
4345
uses: actions/upload-pages-artifact@v3
4446
with:
@@ -53,4 +55,4 @@ jobs:
5355
steps:
5456
- name: Deploy to GitHub Pages
5557
id: deployment
56-
uses: actions/deploy-pages@v4
58+
uses: actions/deploy-pages@v4

.github/workflows/release.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ jobs:
1717
with:
1818
fetch-depth: 0
1919

20+
- run: corepack enable
21+
2022
- uses: pnpm/action-setup@v4
2123
with:
2224
version: 9
@@ -54,4 +56,4 @@ jobs:
5456
gh release create ${{ github.ref_name }} \
5557
--title "${{ github.ref_name }}" \
5658
--notes-file CHANGELOG.md \
57-
${{ contains(github.ref, '-beta') || contains(github.ref, '-alpha') && '--prerelease' || '' }}
59+
${{ (contains(github.ref, '-beta') || contains(github.ref, '-alpha') || contains(github.ref, '-rc')) && '--prerelease' || '' }}

0 commit comments

Comments
 (0)