Skip to content

Commit 266bc66

Browse files
committedJan 2, 2021
[Tests] migrate tests to Github Actions
1 parent 688256a commit 266bc66

File tree

7 files changed

+205
-9
lines changed

7 files changed

+205
-9
lines changed
 

‎.editorconfig

+7
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,17 @@ block_comment_start = /*
1212
block_comment = *
1313
block_comment_end = */
1414

15+
[.nycrc]
16+
indent_style = tab
17+
1518
[*.md]
1619
indent_style = space
1720
indent_size = 4
1821

22+
[*.yml]
23+
indent_style = space
24+
indent_size = 2
25+
1926
[readme.markdown]
2027
indent_size = off
2128
max_line_length = off

‎.github/workflows/node-4+.yml

+54
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
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+
preset: '>=4'
16+
17+
latest:
18+
needs: [matrix]
19+
name: 'latest minors'
20+
runs-on: ubuntu-latest
21+
22+
strategy:
23+
matrix: ${{ fromJson(needs.matrix.outputs.latest) }}
24+
25+
steps:
26+
- uses: actions/checkout@v2
27+
- uses: ljharb/actions/node/run@main
28+
name: 'npm install && npm run tests-only'
29+
with:
30+
node-version: ${{ matrix.node-version }}
31+
command: 'tests-only'
32+
minors:
33+
needs: [matrix, latest]
34+
name: 'non-latest minors'
35+
continue-on-error: true
36+
if: ${{ !github.head_ref || !startsWith(github.head_ref, 'renovate') }}
37+
runs-on: ubuntu-latest
38+
39+
strategy:
40+
matrix: ${{ fromJson(needs.matrix.outputs.minors) }}
41+
42+
steps:
43+
- uses: actions/checkout@v2
44+
- uses: ljharb/actions/node/run@main
45+
with:
46+
node-version: ${{ matrix.node-version }}
47+
command: 'tests-only'
48+
49+
node:
50+
name: 'node 4+'
51+
needs: [latest, minors]
52+
runs-on: ubuntu-latest
53+
steps:
54+
- run: 'echo tests completed'

‎.github/workflows/node-iojs.yml

+58
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
name: 'Tests: node.js (io.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+
preset: 'iojs'
16+
17+
latest:
18+
needs: [matrix]
19+
name: 'latest minors'
20+
runs-on: ubuntu-latest
21+
22+
strategy:
23+
matrix: ${{ fromJson(needs.matrix.outputs.latest) }}
24+
25+
steps:
26+
- uses: actions/checkout@v2
27+
- uses: ljharb/actions/node/run@main
28+
name: 'npm install && npm run tests-only'
29+
with:
30+
node-version: ${{ matrix.node-version }}
31+
command: 'tests-only'
32+
skip-ls-check: true
33+
34+
minors:
35+
needs: [matrix, latest]
36+
name: 'non-latest minors'
37+
continue-on-error: true
38+
if: ${{ !github.head_ref || !startsWith(github.head_ref, 'renovate') }}
39+
runs-on: ubuntu-latest
40+
41+
strategy:
42+
matrix: ${{ fromJson(needs.matrix.outputs.minors) }}
43+
44+
steps:
45+
- uses: actions/checkout@v2
46+
- uses: ljharb/actions/node/run@main
47+
name: 'npm install && npm run tests-only'
48+
with:
49+
node-version: ${{ matrix.node-version }}
50+
command: 'tests-only'
51+
skip-ls-check: true
52+
53+
node:
54+
name: 'io.js'
55+
needs: [latest, minors]
56+
runs-on: ubuntu-latest
57+
steps:
58+
- run: 'echo tests completed'

‎.github/workflows/node-pretest.yml

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: 'Tests: pretest/posttest'
2+
3+
on: [pull_request, push]
4+
5+
jobs:
6+
pretest:
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 pretest'
13+
with:
14+
node-version: 'lts/*'
15+
command: 'pretest'
16+
17+
posttest:
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 posttest'
24+
with:
25+
node-version: 'lts/*'
26+
command: 'posttest'

‎.github/workflows/node-zero.yml

+58
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
name: 'Tests: node.js (0.x)'
2+
3+
on: [pull_request, push]
4+
5+
jobs:
6+
matrix:
7+
runs-on: ubuntu-latest
8+
outputs:
9+
stable: ${{ steps.set-matrix.outputs.requireds }}
10+
unstable: ${{ steps.set-matrix.outputs.optionals }}
11+
steps:
12+
- uses: ljharb/actions/node/matrix@main
13+
id: set-matrix
14+
with:
15+
preset: '0.x'
16+
17+
stable:
18+
needs: [matrix]
19+
name: 'stable minors'
20+
runs-on: ubuntu-latest
21+
22+
strategy:
23+
matrix: ${{ fromJson(needs.matrix.outputs.stable) }}
24+
25+
steps:
26+
- uses: actions/checkout@v2
27+
- uses: ljharb/actions/node/run@main
28+
with:
29+
node-version: ${{ matrix.node-version }}
30+
command: 'tests-only'
31+
cache-node-modules-key: node_modules-${{ github.workflow }}-${{ github.action }}-${{ github.run_id }}
32+
skip-ls-check: true
33+
34+
unstable:
35+
needs: [matrix, stable]
36+
name: 'unstable minors'
37+
continue-on-error: true
38+
if: ${{ !github.head_ref || !startsWith(github.head_ref, 'renovate') }}
39+
runs-on: ubuntu-latest
40+
41+
strategy:
42+
matrix: ${{ fromJson(needs.matrix.outputs.unstable) }}
43+
44+
steps:
45+
- uses: actions/checkout@v2
46+
- uses: ljharb/actions/node/run@main
47+
with:
48+
node-version: ${{ matrix.node-version }}
49+
command: 'tests-only'
50+
cache-node-modules-key: node_modules-${{ github.workflow }}-${{ github.action }}-${{ github.run_id }}
51+
skip-ls-check: true
52+
53+
node:
54+
name: 'node 0.x'
55+
needs: [stable, unstable]
56+
runs-on: ubuntu-latest
57+
steps:
58+
- run: 'echo tests completed'

‎.travis.yml

-7
This file was deleted.

‎test/timeoutAfter.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ tap.test('timeoutAfter with Promises', { skip: typeof Promise === 'undefined' },
8181
return new Promise(function (resolve) {
8282
setTimeout(function () {
8383
resolve();
84-
}, 2);
84+
}, 10);
8585
});
8686
});
8787

@@ -92,7 +92,7 @@ tap.test('timeoutAfter with Promises', { skip: typeof Promise === 'undefined' },
9292
return new Promise(function (reject) {
9393
setTimeout(function () {
9494
reject();
95-
}, 2);
95+
}, 10);
9696
});
9797
});
9898
});

0 commit comments

Comments
 (0)
Please sign in to comment.