Skip to content

Commit 7533b28

Browse files
committed
fix(ci): align workflows with package scripts and support node 20
1 parent d69b9b0 commit 7533b28

2 files changed

Lines changed: 113 additions & 0 deletions

File tree

.github/workflows/nodejs.yml

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [main, stable, 'releases/**']
6+
pull_request:
7+
branches: [main, stable, 'releases/**']
8+
workflow_dispatch:
9+
10+
concurrency:
11+
group: ${{ github.workflow }}-${{ github.ref }}
12+
cancel-in-progress: true
13+
14+
jobs:
15+
verify:
16+
name: Verify (Node ${{ matrix.node-version }})
17+
runs-on: ubuntu-latest
18+
permissions:
19+
contents: read
20+
21+
strategy:
22+
fail-fast: false
23+
matrix:
24+
node-version: [20.x, 22.x]
25+
26+
steps:
27+
- uses: actions/checkout@v4
28+
- name: Setup pnpm
29+
uses: pnpm/action-setup@v4
30+
with:
31+
version: 9
32+
- name: Use Node.js ${{ matrix.node-version }}
33+
uses: actions/setup-node@v4
34+
with:
35+
node-version: ${{ matrix.node-version }}
36+
cache: pnpm
37+
cache-dependency-path: pnpm-lock.yaml
38+
- name: Install dependencies
39+
run: pnpm install --frozen-lockfile
40+
- name: Verify
41+
run: |
42+
pnpm lint
43+
pnpm typecheck
44+
pnpm test
45+
pnpm test:it
46+
pnpm build
47+
env:
48+
CI: true
49+
50+
e2e:
51+
name: E2E (Chromium)
52+
runs-on: ubuntu-latest
53+
permissions:
54+
contents: read
55+
56+
steps:
57+
- uses: actions/checkout@v4
58+
- name: Setup pnpm
59+
uses: pnpm/action-setup@v4
60+
with:
61+
version: 9
62+
- name: Use Node.js 22.x
63+
uses: actions/setup-node@v4
64+
with:
65+
node-version: 22.x
66+
cache: pnpm
67+
cache-dependency-path: pnpm-lock.yaml
68+
- name: Install dependencies
69+
run: pnpm install --frozen-lockfile
70+
- name: Install Playwright browsers
71+
run: pnpm exec playwright install --with-deps chromium
72+
- name: Run E2E
73+
run: pnpm test:e2e
74+
env:
75+
CI: true

.github/workflows/npm-publish.yml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: Node.js Package
2+
3+
on:
4+
release:
5+
types: [published]
6+
7+
concurrency:
8+
group: ${{ github.workflow }}-${{ github.ref }}
9+
cancel-in-progress: false
10+
11+
jobs:
12+
publish-npm:
13+
runs-on: ubuntu-latest
14+
permissions:
15+
contents: read
16+
id-token: write
17+
steps:
18+
- uses: actions/checkout@v4
19+
- name: Setup pnpm
20+
uses: pnpm/action-setup@v4
21+
with:
22+
version: 9
23+
- uses: actions/setup-node@v4
24+
with:
25+
node-version: '22.x'
26+
registry-url: 'https://registry.npmjs.org'
27+
cache: pnpm
28+
cache-dependency-path: pnpm-lock.yaml
29+
- run: pnpm install --frozen-lockfile
30+
- run: pnpm lint
31+
- run: pnpm typecheck
32+
- run: pnpm test
33+
- run: pnpm test:it
34+
- run: pnpm build
35+
- run: npm publish --provenance
36+
env:
37+
NODE_AUTH_TOKEN: ${{secrets.NODE_AUTH_TOKEN}}
38+
CI: true

0 commit comments

Comments
 (0)