File tree 6 files changed +585
-291
lines changed
6 files changed +585
-291
lines changed Original file line number Diff line number Diff line change 1
1
name : ci
2
2
on : push
3
3
4
+ env :
5
+ NODE_VERSIONS : [16.x, 18.x]
6
+
4
7
jobs :
5
8
build :
9
+ name : Build
6
10
runs-on : self-hosted
7
-
8
11
strategy :
9
- max-parallel : 1
10
12
matrix :
11
- node-version : [16.x, 18.x]
12
-
13
+ node-version : ${{ env.NODE_VERSIONS }}
13
14
steps :
14
- - uses : actions/checkout@v2
15
+ - name : Checkout sources
16
+ uses : actions/checkout@v2
15
17
- name : Use Node.js ${{ matrix.node-version }}
16
18
uses : actions/setup-node@v1
17
19
with :
18
20
node-version : ${{ matrix.node-version }}
19
- - run : npm ci
20
- - name : Create .env file
21
+ - name : Installing dependencies
22
+ run : npm ci
23
+ - name : Building sources
24
+ run : npm run build
25
+
26
+ lint :
27
+ name : Lint Code
28
+ needs : build
29
+ runs-on : self-hosted
30
+ strategy :
31
+ matrix :
32
+ node-version : ${{ env.NODE_VERSIONS }}
33
+ steps :
34
+ - name : Linting
35
+ run : npm run lint
36
+ env :
37
+ CI : true
38
+
39
+ test_unit :
40
+ name : Unit Tests
41
+ needs : build
42
+ runs-on : self-hosted
43
+ strategy :
44
+ matrix :
45
+ node-version : ${{ env.NODE_VERSIONS }}
46
+ steps :
47
+ - name : Running unit tests
48
+ run : npm run test:unit
49
+
50
+ test_integration :
51
+ name : Integration Tests
52
+ needs : build
53
+ runs-on : self-hosted
54
+ strategy :
55
+ max-parallel : 1
56
+ matrix :
57
+ node-version : ${{ env.NODE_VERSIONS }}
58
+ steps :
59
+ - name : Creating `.env` file
21
60
run : |
22
61
touch .env
23
62
echo HOST=${{ secrets.HOST }} >> .env
24
63
echo EMAIL=${{ secrets.EMAIL }} >> .env
25
64
echo API_TOKEN=${{ secrets.API_TOKEN }} >> .env
26
- - run : npm run build
27
- - run : npm run test:unit
28
- - run : npm run test:integration
29
- - run : npm run lint
30
- env :
31
- CI : true
65
+ - name : Running integration tests
66
+ run : npm run test:integration
Original file line number Diff line number Diff line change @@ -2,24 +2,62 @@ name: NPM publish
2
2
on : workflow_dispatch
3
3
4
4
jobs :
5
- publish :
5
+ build :
6
+ name : Build
6
7
runs-on : self-hosted
7
8
steps :
8
9
- name : Checkout sources
9
10
uses : actions/checkout@v2
10
- - name : Use Node.js 16
11
- uses : actions/setup-node@v2
11
+ - name : Use Node.js 16.x.x
12
+ uses : actions/setup-node@v1
12
13
with :
13
14
node-version : 16
14
- registry-url : https://registry.npmjs.org/
15
- - name : Install dependencies
15
+ - name : Installing dependencies
16
16
run : npm ci
17
- - name : Create .env file
17
+ - name : Building sources
18
+ run : npm run build
19
+
20
+ lint :
21
+ name : Lint Code
22
+ needs : build
23
+ runs-on : self-hosted
24
+ steps :
25
+ - name : Linting
26
+ run : npm run lint
27
+ env :
28
+ CI : true
29
+
30
+ test_unit :
31
+ name : Unit Tests
32
+ needs : build
33
+ runs-on : self-hosted
34
+ steps :
35
+ - name : Running unit tests
36
+ run : npm run test:unit
37
+
38
+ test_integration :
39
+ name : Integration Tests
40
+ needs : build
41
+ runs-on : self-hosted
42
+ steps :
43
+ - name : Creating `.env` file
18
44
run : |
19
45
touch .env
20
46
echo HOST=${{ secrets.HOST }} >> .env
21
47
echo EMAIL=${{ secrets.EMAIL }} >> .env
22
48
echo API_TOKEN=${{ secrets.API_TOKEN }} >> .env
49
+ - name : Running integration tests
50
+ run : npm run test:integration
51
+
52
+ publish :
53
+ name : Publishing
54
+ needs :
55
+ - build
56
+ - lint
57
+ - test_unit
58
+ - test_integration
59
+ runs-on : self-hosted
60
+ steps :
23
61
- name : Publishing
24
62
run : npm publish
25
63
env :
You can’t perform that action at this time.
0 commit comments