-
Notifications
You must be signed in to change notification settings - Fork 3
79 lines (73 loc) · 2.1 KB
/
test.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
70
71
72
73
74
75
76
77
78
79
name: Test
on:
pull_request:
workflow_call:
jobs:
test:
runs-on: [ubuntu-latest]
services:
postgres:
image: postgres:13-alpine
env:
POSTGRES_PASSWORD: phamphong9981
POSTGRES_USER: phamphong
POSTGRES_DB: test
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 5432:5432
redis:
image: redis:6-alpine
ports:
- 6379:6379
aurad:
image: auranw/local-aurad:dev_v0.7.0-3
ports:
- 1317:1317
- 26657:26657
- 9090:9090
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: '16.14'
- name: Cache node modules
id: cache-npm
uses: actions/cache@v3
env:
cache-name: cache-node-modules
with:
path: ./node_modules
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
- if: ${{ steps.cache-npm.outputs.cache-hit != 'true' }}
name: List the state of node modules
continue-on-error: true
run: npm list
- name: Install dependencies
run: npm install
- name: Setup env
run: cp ci/.env.ci .env
- name: Setup config.json
run: cp ci/config.json.ci config.json
- name: Setup network.json
run: cp ci/network.json.ci network.json
- name: Setup code-type.json
run: cp ci/code-type.json.ci code-type.json
- name: Setup graphql-query-whitelist.json
run: cp ci/graphql-query-whitelist.json.ci graphql-query-whitelist.json
- name: Test
env:
NODE_ENV: test
POSTGRES_PASSWORD: phamphong9981
POSTGRES_USER: phamphong
POSTGRES_DB_TEST: test
run: |
npm run db:migrate:test:latest
npm run test-ci