-
Notifications
You must be signed in to change notification settings - Fork 0
60 lines (54 loc) · 1.67 KB
/
testAndLint.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
name: Node.js CI
on: [push]
jobs:
build:
runs-on: ubuntu-latest
services:
postgres:
image: postgres
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: bantr
ports:
- 5432:5432
# needed because the postgres container does not provide a healthcheck
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
strategy:
matrix:
node-version: [12.x, 14.x]
steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- name: Cache Node.js modules
uses: actions/cache@v1
with:
path: ~/.npm # npm cache files are stored in `~/.npm` on Linux/macOS
key: ${{ runner.OS }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.OS }}-node-
${{ runner.OS }}-
- run: npm ci
- run: npm run lint
- run: npm run build
- run: npm test
env:
BANTR_IS_TEST: true
- run: npm run test:e2e
env:
BANTR_IS_TEST: true
BANTR_PG_USER: postgres
BANTR_PG_PW: postgres
BANTR_PG_DB: bantr
BANTR_PG_HOST: localhost
BANTR_PG_PORT: 5432
- name: Test & publish code coverage
uses: paambaati/codeclimate-action@v2.6.0
env:
CC_TEST_REPORTER_ID: 2c88318d7a2bd3475c4a8cf4519654e6c86807cadb68cf24e4307d96d2b08cfb
with:
coverageCommand: npm run test:cov
debug: true