Skip to content

Commit 2534e9f

Browse files
committed
[Tests] migrate tests to Github Actions
1 parent 3b0bbc6 commit 2534e9f

File tree

2 files changed

+109
-0
lines changed

2 files changed

+109
-0
lines changed

.github/workflows/node-4+.yml

+72
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
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+
steps:
11+
- uses: ljharb/actions/node/matrix@main
12+
id: set-matrix
13+
with:
14+
versionsAsRoot: true
15+
type: 'majors'
16+
preset: '>=4'
17+
18+
latest:
19+
needs: [matrix]
20+
name: 'latest majors'
21+
runs-on: ubuntu-latest
22+
23+
strategy:
24+
matrix:
25+
node-version: ${{ fromJson(needs.matrix.outputs.latest) }}
26+
eslint:
27+
- 7
28+
- 6
29+
- 5
30+
- 4
31+
- 3
32+
exclude:
33+
- node-version: 9
34+
eslint: 7
35+
- node-version: 8
36+
eslint: 7
37+
- node-version: 7
38+
eslint: 7
39+
- node-version: 7
40+
eslint: 6
41+
- node-version: 6
42+
eslint: 7
43+
- node-version: 6
44+
eslint: 6
45+
- node-version: 5
46+
eslint: 7
47+
- node-version: 5
48+
eslint: 6
49+
- node-version: 5
50+
eslint: 5
51+
- node-version: 4
52+
eslint: 7
53+
- node-version: 4
54+
eslint: 6
55+
- node-version: 4
56+
eslint: 5
57+
58+
steps:
59+
- uses: actions/checkout@v2
60+
- uses: ljharb/actions/node/run@main
61+
name: 'npm install && npm run tests-only'
62+
with:
63+
after_install: npm uninstall --no-save eslint-config-airbnb-base && npm install --no-save "eslint@${{ matrix.eslint }}"
64+
node-version: ${{ matrix.node-version }}
65+
command: 'test:ci'
66+
67+
node:
68+
name: 'node 4+'
69+
needs: [latest]
70+
runs-on: ubuntu-latest
71+
steps:
72+
- run: 'echo tests completed'

.github/workflows/node-pretest.yml

+37
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: 'Tests: pretest/posttest'
2+
3+
on: [pull_request, push]
4+
5+
jobs:
6+
lint:
7+
runs-on: ubuntu-latest
8+
9+
steps:
10+
- uses: actions/checkout@v2
11+
- uses: ljharb/actions/node/run@main
12+
name: 'npm install && npm run lint'
13+
with:
14+
node-version: 'lts/*'
15+
command: 'lint'
16+
17+
flow:
18+
runs-on: ubuntu-latest
19+
20+
steps:
21+
- uses: actions/checkout@v2
22+
- uses: ljharb/actions/node/run@main
23+
name: 'npm install && npm run flow'
24+
with:
25+
node-version: 'lts/*'
26+
command: 'flow'
27+
28+
posttest:
29+
runs-on: ubuntu-latest
30+
31+
steps:
32+
- uses: actions/checkout@v2
33+
- uses: ljharb/actions/node/run@main
34+
name: 'npm install && npm run posttest'
35+
with:
36+
node-version: 'lts/*'
37+
command: 'posttest'

0 commit comments

Comments
 (0)