-
Notifications
You must be signed in to change notification settings - Fork 1
82 lines (63 loc) · 2.27 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
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: Create environment variable to pass in GitHub hash for Docker Compose
run: echo "GITHUB_HASH=${{ github.sha }}" >> .env
- name: Build Docker image
id: build
run: |
${{ env.DOCKER_COMPOSE_CMD }} build --build-arg DEV=True appserver
echo "image_hash=$(docker images | awk '{print $1}' | awk 'NR==2')" > $GITHUB_OUTPUT
- name: Migration Integrity Check
run: docker run ${{ steps.build.outputs.image_hash }} bin/migration-integrity-check
- name: Linting and code style
run: |-
docker run ${{ steps.build.outputs.image_hash }} flake8 .
docker run ${{ steps.build.outputs.image_hash }} mypy .
docker run ${{ steps.build.outputs.image_hash }} 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