-
Notifications
You must be signed in to change notification settings - Fork 1
62 lines (60 loc) · 1.73 KB
/
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
name: "Test Suite"
on:
workflow_call:
push:
branches:
- master
- develop
pull_request:
branches:
- master
- develop
jobs:
suite:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
- name: "Configure env"
run: |
cp .env.test .env
sed -i "/^DOCKER_TAG=/c\DOCKER_TAG=${{ github.base_ref || github.ref_name }}" .env
cp docker-compose.override.test.yml docker-compose.override.yml
- name: "Start services"
run: |
docker compose build --pull
docker compose up -d
docker compose exec -T app wait_for_services.sh
- name: "Top"
run: |
docker compose logs
docker compose top
- name: "Install dev dependencies"
run: |
docker compose exec -T app pip install -c requirements/constraints.txt -r requirements/dev.txt
cd frontend
npm install
- name: "Backend tests"
id: "backendTests"
run: |
docker compose exec -T app pytest --cov
- name: "Frontend tests"
run: |
cd frontend
npm run test:unit -- run
- name: "Seed DB"
run: |
docker compose exec -T app ./manage.py seed_db --noinput
- name: "E2E tests"
id: "frontendTests"
run: |
cd frontend
# Don't record videos since we don't upload them
npm run test -- -c 'video=false'
- uses: actions/upload-artifact@v4
if: ${{ failure() && steps.frontendTests.conclusion == 'failure' }}
with:
name: cypress-screenshots
path: frontend/cypress/screenshots/