-
-
Notifications
You must be signed in to change notification settings - Fork 301
54 lines (48 loc) · 1.49 KB
/
pr_test_backend.yml
File metadata and controls
54 lines (48 loc) · 1.49 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
name: 🧪 PR Test Backend
on:
pull_request:
branches:
- main
- staging
- develop
paths:
- "backend/**"
workflow_dispatch:
jobs:
code-check-PEP8:
name: Run PEP8 code style checks
runs-on: ubuntu-latest
steps:
- name: Clone repository
uses: actions/checkout@v4
- name: Set up Python 3.10
uses: actions/setup-python@v4
with:
python-version: "3.10"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install flake8
pip install black==25.1.0
- name: Run PEP8 checks
run: |
flake8 manage.py backend tests migrations --ignore=E203,W503,F401,E501
black --check manage.py backend tests migrations
pytest:
uses: hotosm/gh-workflows/.github/workflows/test_compose.yml@3.2.0
with:
image_name: ghcr.io/${{ github.repository }}/backend
build_context: .
build_dockerfile: ./scripts/docker/Dockerfile
pre_command: |
cp example.env tasking-manager.env
docker compose up -d tm-db tm-backend tm-migration tm-cron-jobs traefik
docker compose exec tm-db bash -c "PGPASSWORD=tm psql -U tm -d tasking-manager <<EOF
CREATE DATABASE taskingmanagertest;
EOF"
compose_file: "docker-compose.yml"
compose_service: tm-backend
compose_command: pytest tests/api/unit/ -p no:warnings
cache_extra_imgs: |
"postgis/postgis:14-3.3"
secrets: inherit