-
-
Notifications
You must be signed in to change notification settings - Fork 678
145 lines (114 loc) · 4.27 KB
/
Copy pathnodejs.yml
File metadata and controls
145 lines (114 loc) · 4.27 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
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
name: CI
on:
push:
branches:
- main
- next
pull_request:
branches:
- main
- next
# A new commit supersedes the previous one's jobs, so stop paying for them
# across the whole matrix below. Only pull request runs share a group; every
# other run gets a group of its own (`github.run_id`), because a group holds
# at most one pending run and a later push would otherwise evict the one
# waiting — `cancel-in-progress` protects the running run, not the queued one.
# Runs for the branches this also builds on push publish the coverage later
# comparisons are measured against, and losing one would also hide a breakage
# that is already on the branch.
concurrency:
group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.ref || github.run_id }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
permissions:
contents: read
jobs:
lint:
name: Lint
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest]
node-version: [lts/*]
webpack-version: [latest]
steps:
- name: Checkout code
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Setup Node.js v${{ matrix.node-version }}
uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
with:
node-version: ${{ matrix.node-version }}
cache: "npm"
- name: Install dependencies
run: npm ci
- name: Build
run: npm run build
- name: Lint
run: npm run lint
test:
name: Test - ${{ matrix.os }} - Node v${{ matrix.node-version }}, Webpack ${{ matrix.webpack-version }}, DevServer ${{ matrix.dev-server-version }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: true
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
node-version: [20.x, 22.x, 24.x, 25.x, 26.x]
webpack-version: [latest]
dev-server-version: [5, latest]
steps:
- name: Checkout code
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
fetch-depth: 0
- name: Using Node.js v${{ matrix.node-version }}
uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
with:
node-version: ${{ matrix.node-version }}
cache: "npm"
- name: Install pnpm
uses: pnpm/action-setup@ea17c68df8912ef543352723c149a84f56e3d413 #6.1.0
with:
version: 10
- name: Install dependencies
run: npm ci --ignore-scripts
- name: Install webpack-dev-server ${{ matrix.dev-server-version }}
if: matrix.dev-server-version == '5'
run: npm install webpack-dev-server@${{ matrix.dev-server-version }} --no-save --ignore-scripts
- name: Prepare environment for tests
run: npm run build -- --sourceMap true
- name: Run tests and generate coverage
run: npm run test:coverage -- --ci
env:
# c8 remaps every script V8 reported before applying its include
# filter, which exceeds Node.js 20's default heap on macOS runners
NODE_OPTIONS: --max-old-space-size=4096
- name: Upload coverage to Codecov
uses: codecov/codecov-action@303a32d7a59b442fa8d48b6a1cc6825c09c847a5 # v7.1.1
with:
token: ${{ secrets.CODECOV_TOKEN }}
smoketests:
name: Smoketests
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest]
node-version: [lts/*]
steps:
- name: Checkout code
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
fetch-depth: 0
- name: Using Node.js v${{ matrix.node-version }}
uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
with:
node-version: ${{ matrix.node-version }}
cache: "npm"
- name: Install dependencies
run: npm ci
- name: Prepare environment for tests
run: npm run build -- --sourceMap true
- name: Run smoketests
run: npm run test:smoketests
- name: Upload coverage to Codecov
uses: codecov/codecov-action@303a32d7a59b442fa8d48b6a1cc6825c09c847a5 # v7.1.1
with:
token: ${{ secrets.CODECOV_TOKEN }}