-
Notifications
You must be signed in to change notification settings - Fork 10
92 lines (88 loc) · 2.78 KB
/
Copy pathnodejs.yml
File metadata and controls
92 lines (88 loc) · 2.78 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
name: Node.js build
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: ['20', '22', '24', '25']
steps:
- uses: actions/checkout@v5
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v5
with:
node-version: ${{ matrix.node-version }}
check-latest: true
- name: Cache Node.js modules
id: yarn-cache
uses: actions/cache@v5
with:
path: '**/node_modules'
key: ${{ runner.os }}-modules-${{ hashFiles('**/package.json') }}-${{ matrix.node-version }}
- name: Install dependencies
if: steps.yarn-cache.outputs.cache-hit != 'true'
run: yarn install
- name: Build (dual CJS + ESM)
run: yarn build
- name: Run CJS integration test
run: yarn test:integration:cjs
- name: Run ESM integration test
run: yarn test:integration:esm
- name: Run examples
run: node examples/example.js
verify-package:
runs-on: ubuntu-latest
needs: build
steps:
- uses: actions/checkout@v5
- name: Use Node.js 22 (LTS)
uses: actions/setup-node@v5
with:
node-version: '22'
check-latest: true
- name: Cache Node.js modules
id: yarn-cache
uses: actions/cache@v5
with:
path: '**/node_modules'
key: ${{ runner.os }}-modules-${{ hashFiles('**/package.json') }}-22
- name: Install dependencies
if: steps.yarn-cache.outputs.cache-hit != 'true'
run: yarn install
- name: Verify published artifact (pack, publint, attw)
run: yarn verify:package
deno:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: ['20', '22', '24', '25']
steps:
- uses: actions/checkout@v5
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v5
with:
node-version: ${{ matrix.node-version }}
check-latest: true
- name: Cache Node.js modules
id: yarn-cache
uses: actions/cache@v5
with:
path: '**/node_modules'
key: ${{ runner.os }}-modules-${{ hashFiles('**/package.json') }}-${{ matrix.node-version }}-deno
- name: Install dependencies
if: steps.yarn-cache.outputs.cache-hit != 'true'
run: yarn install
- name: Build (dual CJS + ESM)
run: yarn build
- name: Setup Deno
uses: denoland/setup-deno@v2
with:
deno-version: v2.x
- name: Run Deno CJS integration test
run: deno run --allow-read test/integration/deno.ts
- name: Run Deno ESM integration test
run: deno run --allow-read test/integration/deno-esm.ts