1
- name : CI workflow
1
+ name : CI
2
2
3
- on : [push, pull_request]
3
+ on :
4
+ push :
5
+ paths-ignore :
6
+ - ' docs/**'
7
+ - ' *.md'
8
+ pull_request :
9
+ paths-ignore :
10
+ - ' docs/**'
11
+ - ' *.md'
4
12
5
13
jobs :
6
- build :
14
+ test :
7
15
runs-on : ubuntu-latest
8
16
strategy :
9
17
matrix :
10
- node : [10, 12, 14]
11
-
12
- name : Node.js ${{ matrix.node }}
13
-
18
+ node-version : [10.x, 12.x, 14.x]
19
+
14
20
services :
15
21
postgres :
16
22
image : postgres:11-alpine
@@ -25,25 +31,51 @@ jobs:
25
31
options : --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
26
32
27
33
steps :
28
- - uses : actions/checkout@v1
34
+ - uses : actions/checkout@v2
35
+
36
+ - name : Use Node.js
37
+
29
38
with :
30
39
node-version : ${{ matrix.node-version }}
31
40
41
+ - name : Install Dependencies
42
+ run : |
43
+ npm install
44
+
32
45
- name : CI environment setup
33
46
run : |
34
47
npm i node-gyp
35
48
sudo apt-get install -yqq libpq-dev postgresql-client
36
49
chmod 600 .pgpass
37
50
PGPASSFILE=.pgpass psql -h localhost -p ${{ job.services.postgres.ports[5432] }} -d postgres -c 'CREATE TABLE users(id serial PRIMARY KEY, username VARCHAR (50) NOT NULL);' -U postgres
38
51
39
- - name : Install
40
- run : npm install
52
+ - name : Check licenses
53
+ run : |
54
+ npm run license-checker --if-present
55
+
56
+ - name : Run tests
57
+ run : |
58
+ npm run test:ci
59
+
60
+ - name : Coveralls Parallel
61
+ uses :
coverallsapp/[email protected]
62
+ with :
63
+ github-token : ${{ secrets.github_token }}
64
+ parallel : true
65
+ flag-name : run-${{ matrix.node-version }}-${{ matrix.os }}
41
66
42
- - name : Run tests
43
- run : npm run test
67
+ coverage :
68
+ needs : test
69
+ runs-on : ubuntu-latest
70
+ steps :
71
+ - name : Coveralls Finished
72
+ uses :
coverallsapp/[email protected]
73
+ with :
74
+ github-token : ${{ secrets.GITHUB_TOKEN }}
75
+ parallel-finished : true
44
76
45
77
automerge :
46
- needs : build
78
+ needs : test
47
79
runs-on : ubuntu-latest
48
80
steps :
49
81
- uses : fastify/github-action-merge-dependabot@v1
0 commit comments