Skip to content

Commit 15e3a33

Browse files
committed
[actions] split node tests into multiple workflows
1 parent 4a92667 commit 15e3a33

File tree

2 files changed

+62
-2
lines changed

2 files changed

+62
-2
lines changed

.github/workflows/node-18+.yml

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
name: 'Tests: node.js'
2+
3+
on: [pull_request, push]
4+
5+
jobs:
6+
matrix:
7+
runs-on: ubuntu-latest
8+
outputs:
9+
latest: ${{ steps.set-matrix.outputs.requireds }}
10+
minors: ${{ steps.set-matrix.outputs.optionals }}
11+
steps:
12+
- uses: ljharb/actions/node/matrix@main
13+
id: set-matrix
14+
with:
15+
versionsAsRoot: true
16+
type: majors
17+
preset: '>=18'
18+
19+
latest:
20+
needs: [matrix]
21+
name: 'latest majors'
22+
runs-on: ubuntu-latest
23+
24+
strategy:
25+
fail-fast: false
26+
matrix:
27+
node-version: ${{ fromJson(needs.matrix.outputs.latest) }}
28+
eslint:
29+
- 8
30+
- 7
31+
- 6
32+
- 5
33+
- 4
34+
- 4.14 # last version without messageId
35+
- 3
36+
babel-eslint:
37+
- 10
38+
- 9
39+
- 8
40+
41+
steps:
42+
- uses: actions/checkout@v3
43+
- uses: ljharb/actions/node/install@main
44+
name: 'nvm install ${{ matrix.node-version }} && npm install'
45+
with:
46+
node-version: ${{ matrix.node-version }}
47+
after_install: |
48+
npm install --no-save "eslint@${{ matrix.eslint }}" "@typescript-eslint/parser@5" "babel-eslint@${{ matrix.babel-eslint }}"
49+
env:
50+
NPM_CONFIG_LEGACY_PEER_DEPS: true
51+
- run: npx ls-engines
52+
- run: npm run unit-test
53+
- uses: codecov/codecov-action@v3
54+
55+
node:
56+
name: 'node 18+'
57+
needs: [latest]
58+
runs-on: ubuntu-latest
59+
steps:
60+
- run: 'echo tests completed'

.github/workflows/node-4+.yml renamed to .github/workflows/node-minors.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
with:
1515
versionsAsRoot: true
1616
type: majors
17-
preset: '>=4'
17+
preset: '>=4 < 18'
1818

1919
latest:
2020
needs: [matrix]
@@ -110,7 +110,7 @@ jobs:
110110
- uses: codecov/codecov-action@v3
111111

112112
node:
113-
name: 'node 4+'
113+
name: 'node 4 - 17'
114114
needs: [latest]
115115
runs-on: ubuntu-latest
116116
steps:

0 commit comments

Comments
 (0)