-
Notifications
You must be signed in to change notification settings - Fork 1
87 lines (68 loc) · 2.45 KB
/
integration-tests.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
80
81
82
83
84
85
86
87
name: Integration Checks
on:
workflow_dispatch:
pull_request:
jobs:
appserver:
name: Appserver Linting and Testing
runs-on: ubuntu-latest
env:
DOCKER_COMPOSE_CMD: docker-compose -f docker-compose.ci-test.yml
steps:
- name: Cancel Previous Runs
if: github.event_name != 'workflow_dispatch'
uses: styfle/[email protected]
with:
access_token: ${{ github.token }}
- uses: actions/checkout@v3
- name: Build appserver image
uses: whoan/docker-build-with-cache-action@v5
with:
username: ${{ secrets.AZURE_CR_USERNAME }}
password: ${{ secrets.AZURE_CR_PASSWORD }}
registry: ***ARANGO_DB_NAME***.azurecr.io
image_name: kg-appserver
image_tag: ${{ github.sha }}
context: ./appserver
dockerfile: ./Dockerfile
- name: Create environment variable to pass in GitHub hash for Docker Compose
run: echo "GITHUB_HASH=${{ github.sha }}" >> .env
- name: Migration Integrity Check
run: ${{ env.DOCKER_COMPOSE_CMD }} run --no-deps appserver bin/migration-integrity-check
- name: Linting and code style
run: |-
${{ env.DOCKER_COMPOSE_CMD }} run --no-deps appserver flake8 .
${{ env.DOCKER_COMPOSE_CMD }} run --no-deps appserver mypy .
${{ env.DOCKER_COMPOSE_CMD }} run --no-deps appserver pycodestyle .
- name: Bring up containers and wait for webserver to be ready
timeout-minutes: 10
run: |-
${{ env.DOCKER_COMPOSE_CMD }} up -d
${{ env.DOCKER_COMPOSE_CMD }} exec -T appserver bin/wait-for-flask
- name: Run PyTest
run: ${{ env.DOCKER_COMPOSE_CMD }} exec -T appserver pytest tests -p no:warnings
- name: Show Docker logs
if: ${{ failure() }}
run: ${{ env.DOCKER_COMPOSE_CMD }} logs --timestamps
client:
name: Client Linting and Testing
runs-on: ubuntu-latest
defaults:
run:
working-directory: client
steps:
- uses: actions/checkout@v3
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: 14
cache: yarn
cache-dependency-path: client/yarn.lock
- name: Install dependencies
run: yarn install --frozen-lockfile
- name: Build application
run: yarn build
- name: Run linter
run: yarn lint-ci
- name: Run tests
run: yarn test