Skip to content

Commit f452604

Browse files
committed
[Tests] migrate tests to Github Actions
1 parent 64fa035 commit f452604

File tree

2 files changed

+119
-0
lines changed

2 files changed

+119
-0
lines changed

.github/workflows/node-4+.yml

+79
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
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: 5
52+
eslint: 4
53+
- node-version: 4
54+
eslint: 7
55+
- node-version: 4
56+
eslint: 6
57+
- node-version: 4
58+
eslint: 5
59+
- node-version: 4 # TODO: fix
60+
eslint: 4
61+
- node-version: 4 # TODO: fix
62+
eslint: 3
63+
64+
steps:
65+
- uses: actions/checkout@v2
66+
- uses: ljharb/actions/node/run@main
67+
name: 'npm install && npm run tests-only'
68+
with:
69+
after_install: npm uninstall --no-save eslint-config-airbnb-base && npm install --no-save "eslint@${{ matrix.eslint }}"
70+
node-version: ${{ matrix.node-version }}
71+
command: 'test:ci'
72+
skip-ls-check: true
73+
74+
node:
75+
name: 'node 4+'
76+
needs: [latest]
77+
runs-on: ubuntu-latest
78+
steps:
79+
- run: 'echo tests completed'

.github/workflows/node-pretest.yml

+40
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
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+
skip-ls-check: true
17+
18+
flow:
19+
runs-on: ubuntu-latest
20+
21+
steps:
22+
- uses: actions/checkout@v2
23+
- uses: ljharb/actions/node/run@main
24+
name: 'npm install && npm run flow'
25+
with:
26+
node-version: 'lts/*'
27+
command: 'flow'
28+
skip-ls-check: true
29+
30+
posttest:
31+
runs-on: ubuntu-latest
32+
33+
steps:
34+
- uses: actions/checkout@v2
35+
- uses: ljharb/actions/node/run@main
36+
name: 'npm install && npm run posttest'
37+
with:
38+
node-version: 'lts/*'
39+
command: 'posttest'
40+
skip-ls-check: true

0 commit comments

Comments
 (0)