8000 [Tests] migrate tests to Github Actions · dk-dev/javascript@ea5b991 · GitHub
[go: up one dir, main page]

Skip to content

Commit ea5b991

Browse files
committed
[Tests] migrate tests to Github Actions
1 parent 2a6bec1 commit ea5b991

File tree

5 files changed

+208
-108
lines changed

5 files changed

+208
-108
lines changed

.github/workflows/node-pretest.yml

Lines changed: 26 additions & 0 deletions
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+
strategy:
9+
fail-fast: false
10+
matrix:
11+
package:
12+
- '..'
13+
- eslint-config-airbnb
14+
- eslint-config-airbnb-base
15+
16+
defaults:
17+
run:
18+
working-directory: "packages/${{ matrix.package }}"
19+
20+
steps:
21+
- uses: actions/checkout@v2
22+
- uses: ljharb/actions/node/install@main
23+
name: 'nvm install lts/* && npm install'
24+
with:
25+
node-version: 'lts/*'
26+
- run: npm run pretest

.github/workflows/node.yml

Lines changed: 155 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,155 @@
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: '^10 || ^12 || ^14 || ^16 || >= 17'
17+
18+
base:
19+
needs: [matrix]
20+
name: 'base config'
21+
runs-on: ubuntu-latest
22+
23+
strategy:
24+
fail-fast: false
25+
matrix:
26+
node-version: ${{ fromJson(needs.matrix.outputs.latest) }}
27+
eslint:
28+
- 7
29+
- 6
30+
- 5
31+
package:
32+
- eslint-config-airbnb-base
33+
34+
defaults:
35+
run:
36+
working-directory: "packages/${{ matrix.package }}"
37+
38+
steps:
39+
- uses: actions/checkout@v2
40+
- uses: ljharb/actions/node/install@main
41+
name: 'nvm install ${{ matrix.node-version }} && npm install'
42+
with:
43+
node-version: ${{ matrix.node-version }}
44+
- run: npm run travis
45+
- uses: codecov/codecov-action@v2
46+
47+
react:
48+
needs: [matrix]
49+
name: 'react config'
50+
runs-on: ubuntu-latest
51+
52+
strategy:
53+
fail-fast: false
54+
matrix:
55+
node-version: ${{ fromJson(needs.matrix.outputs.latest) }}
56+
eslint:
57+
- 7
58+
- 6
59+
- 5
60+
package:
61+
- eslint-config-airbnb
62+
react-hooks:
63+
- ''
64+
- 3
65+
- 2.3
66+
- 1.7
67+
68+
defaults:
69+
run:
70+
working-directory: "packages/${{ matrix.package }}"
71+
72+
steps:
73+
- uses: actions/checkout@v2
74+
- uses: ljharb/actions/node/install@main
75+
name: 'nvm install ${{ matrix.node-version }} && npm install'
76+
with:
77+
node-version: ${{ matrix.node-version }}
78+
after_install: |
79+
npm install --no-save "eslint@${{ matrix.eslint }}"
80+
- run: npm install --no-save "eslint-plugin-react-hooks@${{ matrix.react-hooks }}"
81+
if: ${{ matrix.react-hooks > 0}}
82+
- run: npm run travis
83+
- uses: codecov/codecov-action@v2
84+
85+
prepublish-base:
86+
name: 'prepublish tests (base config)'
87+
runs-on: ubuntu-latest
88+
strategy:
89+
fail-fast: false
90+
matrix:
91+
eslint:
92+
- 7
93+
- 6
94+
- 5
95+
package:
96+
- eslint-config-airbnb-base
97+
98+
defaults:
99+
run:
100+
working-directory: "packages/${{ matrix.package }}"
101+
102+
steps:
103+
- uses: actions/checkout@v2
104+
- uses: ljharb/actions/node/install@main
105+
name: 'nvm install ${{ matrix.node-version }} && npm install'
106+
with:
107+
node-version: lts/*
108+
after_install: |
109+
npm install --no-save "eslint@${{ matrix.eslint }}"
110+
- run: npm run pretravis
111+
- run: npm run prepublish
112+
- run: npm run posttravis
113+
114+
prepublish-react:
115+
name: 'prepublish tests (react config)'< 52F4 /div>
116+
runs-on: ubuntu-latest
117+
strategy:
118+
fail-fast: false
119+
matrix:
120+
eslint:
121+
- 7
122+
- 6
123+
- 5
124+
package:
125+
- eslint-config-airbnb
126+
react-hooks:
127+
- ''
128+
- 3
129+
- 2.3
130+
- 1.7
131+
132+
defaults:
133+
run:
134+
working-directory: "packages/${{ matrix.package }}"
135+
136+
steps:
137+
- uses: actions/checkout@v2
138+
- uses: ljharb/actions/node/install@main
139+
name: 'nvm install ${{ matrix.node-version }} && npm install'
140+
with:
141+
node-version: lts/*
142+
after_install: |
143+
npm install --no-save "eslint@${{ matrix.eslint }}"
144+
- run: npm install --no-save "eslint-plugin-react-hooks@${{ matrix.react-hooks }}"
145+
if: ${{ matrix.react-hooks > 0}}
146+
- run: npm run pretravis
147+
- run: npm run prepublish
148+
- run: npm run posttravis
149+
150+
node:
151+
name: 'node 10+'
152+
needs: [base, prepublish-base, react, prepublish-react]
153+
runs-on: ubuntu-latest
154+
steps:
155+
- run: 'echo tests completed'

.github/workflows/rebase.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
name: Automatic Rebase
2+
3+
on: [pull_request_target]
4+
5+
jobs:
6+
_:
7+
name: "Automatic Rebase"
8+
9+
runs-on: ubuntu-latest
10+
11+
steps:
12+
- uses: actions/checkout@v2
13+
- uses: ljharb/rebase@master
14+
env:
15+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
name: Require “Allow Edits”
2+
3+
on: [pull_request_target]
4+
5+
jobs:
6+
_:
7+
name: "Require “Allow Edits”"
8+
9+
runs-on: ubuntu-latest
10+
11+
steps:
12+
- uses: ljharb/require-allow-edits@main

.travis.yml

Lines changed: 0 additions & 108 deletions
This file was deleted.

0 commit comments

Comments
 (0)
0