Repository navigation
78 lines (67 loc) · 2.39 KB
/
Copy pathnode.yml
File metadata and controls
78 lines (67 loc) · 2.39 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
name: node
# tests every pushed branch in Node, Deno and Bun, and pull requests from forks (pull requests from branches of this repository are
# already tested by their push); release.yml runs it before publishing
on:
push:
branches: ['**']
pull_request:
workflow_call:
# a newer push to the same branch cancels the tests of the previous one
concurrency:
group: node-${{ github.event_name }}-${{ github.ref }}
cancel-in-progress: ${{ github.event_name != 'release' }}
jobs:
build:
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.repository
runs-on: ${{ matrix.os }}
name: node ${{ matrix.version }} | ${{ matrix.os }}
strategy:
matrix:
version: [22.13.0, 22.x, 24.x, 26.x]
os: [macos-latest, ubuntu-latest, windows-latest]
steps:
- uses: actions/checkout@v7
- uses: actions/setup-node@v7
with:
node-version: ${{ matrix.version }}
- run: npm install
- run: npm test
lint:
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.repository
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- uses: actions/setup-node@v7
with:
node-version: 24.x
- run: npm install
- run: npm run lint
# the same tests in Deno and Bun (built with node, run by tests/run.js in the runtime running it)
runtimes:
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.repository
runs-on: ${{ matrix.os }}
name: ${{ matrix.runtime }} | ${{ matrix.os }}
strategy:
matrix:
runtime: [deno, bun]
os: [macos-latest, ubuntu-latest, windows-latest]
steps:
- uses: actions/checkout@v7
- uses: actions/setup-node@v7
with:
node-version: 24.x
- if: matrix.runtime == 'deno'
uses: denoland/setup-deno@v2
with:
deno-version: v2.x
- if: matrix.runtime == 'bun'
uses: oven-sh/setup-bun@v2
- run: npm install
- run: npm run build
- if: matrix.runtime == 'deno'
run: deno run -A tests/run.js
- if: matrix.runtime == 'bun'
run: bun tests/run.js
# (JSR type checks the sources with Deno's TypeScript, stricter than ours: what release.yml would publish)
- if: matrix.runtime == 'deno' && matrix.os == 'ubuntu-latest'
run: deno publish --dry-run --allow-dirty