-
Notifications
You must be signed in to change notification settings - Fork 3
47 lines (44 loc) · 1.13 KB
/
iic2513-node.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
name: IIC2513 Node CI
on: pull_request
jobs:
tests:
name: Tests and linters
timeout-minutes: 10
runs-on: ubuntu-latest
env:
DATABASE_URL: postgresql://localhost/postgres
DB_DIALECT: postgres
DB_USERNAME: postgres
DB_PASSWORD: password
JWT_SECRET: some-secret
NODE_ENV: test
services:
db:
env:
POSTGRES_HOST_AUTH_METHOD: trust
image: postgres:12.4
ports: ['5432:5432']
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
strategy:
matrix:
node-version: [ 12.x ]
steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node-version }}
- name: Install dependencies
run: yarn install
- name: Setup Database
run: |
yarn sequelize db:create
yarn sequelize db:migrate
- name: Run ESLint
run: yarn lint
- name: Run jest tests
run: yarn test --silent