-
Notifications
You must be signed in to change notification settings - Fork 4
64 lines (50 loc) · 1.43 KB
/
test.yml
File metadata and controls
64 lines (50 loc) · 1.43 KB
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
name: Test
on:
push:
branches:
- 'develop'
pull_request:
types:
- opened
- synchronize
- reopened
- ready_for_review
jobs:
test:
runs-on: ubuntu-latest
if: github.event.pull_request.draft == false
timeout-minutes: 30
steps:
- name: Cancel Previous Runs
uses: styfle/cancel-workflow-action@0.11.0
with:
access_token: ${{ github.token }}
- uses: actions/checkout@v2
with:
ref: ${{ github.event.pull_request.head.sha }}
- name: Checkout
uses: actions/checkout@v2
- name: Setup node from node version file
uses: actions/setup-node@v2
with:
node-version-file: '.nvmrc'
cache: 'npm'
- name: Install
if: steps.cache-node-modules.outputs.cache-hit != 'true'
run: yarn install
- name: Lint
run: yarn lint
- name: Validate Swagger Docs
run: yarn docs:validate
- name: Docker - Pull
run: docker-compose pull
- name: Docker - Start Test DB
run: docker-compose up --build -d test-db
- name: Migrate database
run: for i in {1..6}; do yarn migrate:test && break || sleep 10; done # retries up to 6 times every 10 s if db is not available
- name: Run API tests
run: yarn test
- name: Run Cypress tests
run: yarn e2e
- name: Docker Cleanup
run: docker-compose kill