This repository has been archived by the owner on Jun 24, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 9
56 lines (41 loc) · 1.65 KB
/
main.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
name: Geocity CI
on: [push, pull_request]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: "Lint Code"
uses: pre-commit/[email protected]
- name: Configure stack
run: cp .env.example .env
- name: Build/Pull Containers
run: docker-compose build
- name: Start full stack
run: docker-compose up -d
- name: Sanity Checks
run: |
WEB_OK=$(docker ps -aq --filter status="running" --filter name="geocity_web_1") && if [ -z "$WEB_OK" ]; then exit 1; fi
POSTGRES_OK=$(docker ps -aq --filter status="running" --filter name="geocity_postgres_1") && if [ -z "$POSTGRES_OK" ]; then exit 1; fi
- name: Stop web container
run: docker-compose stop web
- name: Run tests (with 2FA)
env:
ENABLE_2FA: "true"
run: |
docker-compose run --service-ports --name=web --rm --entrypoint="" web coverage run --source='.' ./manage.py test --settings=geocity.settings_test --keepdb
- name: Coverage report (with 2FA)
run: docker-compose run --rm --entrypoint="" web coverage report -m
- name: Run tests (without 2FA)
env:
ENABLE_2FA: "false"
run: |
docker-compose run --service-ports --name=web --rm --entrypoint="" web coverage run --source='.' ./manage.py test --settings=geocity.settings_test --keepdb
- name: Coverage report (without 2FA)
run: docker-compose run --rm --entrypoint="" web coverage report -m
- name: Upload test output images
if: failure()
uses: actions/upload-artifact@v3
with:
name: test-output-images
path: ./geocity/apps/reports/tests/data