-
-
Notifications
You must be signed in to change notification settings - Fork 50
91 lines (82 loc) · 2.37 KB
/
pytest.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
88
89
90
91
name: pytest
on:
# Run tests on all pushed branches
push:
branches:
- "*"
# Run tests on PR, prior to merge to main & development.
pull_request:
branches:
- main
- staging
- development
# Allow manual trigger (workflow_dispatch)
workflow_dispatch:
permissions:
contents: read
jobs:
test:
runs-on: ubuntu-latest
environment:
name: test
container:
image: ghcr.io/hotosm/fmtm/backend:ci-${{ github.base_ref || github.ref_name }}
env:
ODK_CENTRAL_URL: ${{ vars.ODK_CENTRAL_URL }}
ODK_CENTRAL_USER: ${{ vars.ODK_CENTRAL_USER }}
ODK_CENTRAL_PASSWD: ${{ vars.ODK_CENTRAL_PASSWD }}
OSM_CLIENT_ID: ${{ vars.OSM_CLIENT_ID }}
OSM_CLIENT_SECRET: ${{ vars.OSM_CLIENT_SECRET }}
OSM_SECRET_KEY: ${{ vars.OSM_SECRET_KEY }}
FRONTEND_MAIN_URL: ${{ vars.FRONTEND_MAIN_URL }}
FRONTEND_MAP_URL: ${{ vars.FRONTEND_MAP_URL }}
options: --user root
services:
# Start backend database
fmtm-db:
image: postgis/postgis:14-3.3-alpine
env:
POSTGRES_PASSWORD: fmtm
POSTGRES_DB: fmtm
POSTGRES_USER: fmtm
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
# Start ODK Central database
central-db:
image: "postgis/postgis:14-3.3-alpine"
env:
POSTGRES_PASSWORD: odk
POSTGRES_DB: odk
POSTGRES_USER: odk
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
# Start ODK Central
central:
image: "ghcr.io/hotosm/fmtm/odkcentral:v2023.2.1"
env:
DOMAIN: local
SYSADMIN_EMAIL: [email protected]
SYSADMIN_PASSWD: odk
HTTPS_PORT: 443
DB_HOST: central-db
DB_USER: odk
DB_PASSWORD: odk
DB_NAME: odk
SENTRY_ORG_SUBDOMAIN: o130137
SENTRY_KEY: 3cf75f54983e473da6bd07daddf0d2ee
SENTRY_PROJECT: 1298632
# Start proxy to access ODK Central
central-proxy:
image: "ghcr.io/hotosm/fmtm/odkcentral-proxy:latest"
steps:
- uses: actions/checkout@v3
- name: Run pytest as appuser
run: |
cd src/backend
gosu appuser pytest