forked from City-of-Helsinki/respa
-
Notifications
You must be signed in to change notification settings - Fork 3
57 lines (52 loc) · 1.64 KB
/
respa-ci.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
name: Respa-github-ci
on:
pull_request:
branches:
- tre-varaamo
- tre-varaamo-qa
jobs:
build:
runs-on: ubuntu-latest
env:
DEBUG: True
DATABASE_URL: postgis://postgres:postgres@localhost/respa
steps:
- uses: actions/checkout@v3
- name: Set up python 3.8
uses: actions/setup-python@v2
with:
python-version: "3.8"
- name: Install Ubuntu packages
run: |
sudo apt-get update && sudo apt-get install -y gdal-bin gettext libxml2-dev libxslt-dev python3-dev python3-lxml
- name: Install postgres extensions
run: |
psql -h localhost -U postgres template1 -c 'create extension hstore;create extension postgis;'
# Reinstall the uneditable version of django-tamusers for CI as it tries to run
# the tests for that module which breaks. Also remove the location of source code.
- name: Install python packages
run: |
pip install setuptools wheel
pip install -r requirements.txt
# Not sure why some of the strings are not translated during test. Thus,
# explicitly compile messages.
- name: Compile the messages
run: |
python manage.py compilemessages
- name: Run pytest
run: |
py.test .
services:
postres:
image: postgis/postgis:10-2.5
env:
# It lets postgres user login without password so postgres extensions can be
# installed
POSTGRES_HOST_AUTH_METHOD: trust
ports:
- 5432:5432
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5