-
Notifications
You must be signed in to change notification settings - Fork 1
69 lines (61 loc) · 1.79 KB
/
ci.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
61
62
63
64
65
66
67
68
69
name: CI
on:
- push
- workflow_dispatch
jobs:
server_ts_build:
name: Check server ts build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: "12"
- uses: actions/cache@v2
with:
path: ~/.npm
key: ci-server-${{ runner.os }}-${{ hashFiles('server/package-lock.json') }}
- name: Install dependencies
run: npm install
working-directory: server
- name: Check tsc
run: npx tsc
working-directory: server
api_tests:
name: API tests
needs: server_ts_build
runs-on: ubuntu-latest
services:
mongo:
image: mongo
ports:
- 27017:27017
env:
MONGO_INITDB_ROOT_USERNAME: test
MONGO_INITDB_ROOT_PASSWORD: test
MONGO_INITDB_DATABASE: housing-database
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: "12"
- uses: actions/cache@v2
with:
path: ~/.npm
key: ci-server-${{ runner.os }}-${{ hashFiles('server/package-lock.json') }}
- name: Install dependencies
run: npm install
working-directory: server
- name: Seed housing-database
run: bash reload_db.sh mongodb://test:test@localhost:${{ job.services.mongo.ports[27017] }}/housing-database?authSource=admin
working-directory: server/test_data
- name: Run tests
run: npm test
env:
MONGO_DB_CLUSTER_USERNAME: test
MONGO_DB_PASSWORD: test
MONGO_DB_HOST: localhost:${{ job.services.mongo.ports[27017] }}
MONGO_DB_PREFIX: mongodb
SERVER_PORT: 3000
SESSION_SECRET: test
working-directory: server