-
-
Notifications
You must be signed in to change notification settings - Fork 607
145 lines (114 loc) · 3.68 KB
/
nodejs.yml
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: webpack-cli
on:
push:
branches:
- master
pull_request:
branches:
- master
- next
permissions:
contents: read
jobs:
lint:
name: Lint - ${{ matrix.os }} - Node v${{ matrix.node-version }}
runs-on: ${{ matrix.os }}
concurrency:
group: lint-${{ github.ref }}
cancel-in-progress: true
strategy:
matrix:
os: [ubuntu-latest]
node-version: [lts/*]
webpack-version: [latest]
steps:
- uses: actions/checkout@v4
- name: Using Node v${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: "yarn"
- name: Install dependencies
run: yarn --frozen-lockfile
- name: Build
run: yarn build
- name: Lint
run: yarn lint
build:
name: Tests and Coverage - ${{ matrix.os }} - Node v${{ matrix.node-version }}, Webpack ${{ matrix.webpack-version }}, DevServer ${{ matrix.dev-server-version }} (${{ matrix.shard }})
runs-on: ${{ matrix.os }}
concurrency:
group: build-${{ matrix.os }}-v${{ matrix.node-version }}-${{ matrix.webpack-version }}-${{ matrix.dev-server-version }}-${{ matrix.shard }}-${{ github.ref }}
cancel-in-progress: true
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
node-version: [18.x, 20.x, 22.x, 23.x]
shard: ["1/4", "2/4", "3/4", "4/4"]
webpack-version: [latest]
dev-server-version: [latest]
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Using Node v${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: "yarn"
- uses: pnpm/action-setup@v4
with:
version: 9
- name: Install dependencies
run: yarn --frozen-lockfile --ignore-engines --ignore-scripts
- name: Prepare environment for tests
run: yarn build:ci
- name: Run tests and generate coverage
run: yarn test:coverage --ci --shard=${{ matrix.shard }}
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4
smoketests:
name: Smoketests - ${{ matrix.os }} - Node v${{ matrix.node-version }}
runs-on: ubuntu-latest
concurrency:
group: smoketests-${{ github.ref }}
cancel-in-progress: true
strategy:
matrix:
os: [ubuntu-latest]
node-version: [lts/*]
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Using Node v${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: "yarn"
- name: Install dependencies
run: yarn --frozen-lockfile --ignore-engines
- name: Prepare environment for tests
run: yarn build:ci
- name: Run smoketests
run: yarn test:smoketests
commitlint:
name: Lint Commit Messages
runs-on: ubuntu-latest
concurrency:
group: commitlint-${{ github.ref }}
cancel-in-progress: true
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-node@v4
with:
node-version: "lts/*"
cache: "yarn"
- run: yarn --frozen-lockfile
- name: Validate PR commits with commitlint
if: github.event_name == 'pull_request'
run: npx commitlint --from ${{ github.event.pull_request.head.sha }}~${{ github.event.pull_request.commits }} --to ${{ github.event.pull_request.head.sha }} --verbose
env:
NODE_PATH: ${{ github.workspace }}/node_modules