-
Notifications
You must be signed in to change notification settings - Fork 2
66 lines (62 loc) · 1.7 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
57
58
59
60
61
62
63
64
65
66
name: Test and deploy
on:
push:
branches:
- main
- deploy
pull_request:
jobs:
test:
name: Run tests
runs-on: ubuntu-20.04
services:
postgres:
image: postgis/postgis:14-3.2
env:
POSTGRES_DB: lametro
POSTGRES_PASSWORD: postgres
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 5432:5432
elasticsearch:
image: elasticsearch:7.14.2
ports:
- 9200:9200
env:
discovery.type: single-node
options: >-
--health-cmd "curl http://localhost:9200/_cluster/health"
--health-interval 10s
--health-timeout 5s
--health-retries 10
steps:
- uses: actions/checkout@v2
- name: Lint the code
run: |
pip install black flake8
flake8 . --exclude lametro/migrations,councilmatic/settings*
black --check . --exclude lametro/migrations councilmatic/settings.py councilmatic/settings_jurisdiction.py
- name: Install system dependencies
run: |
sudo apt-get update
sudo apt-get install gdal-bin
- name: Set up Python 3.10
uses: actions/setup-python@v2
with:
python-version: '3.10'
- name: Install dependencies
run: |
python -m pip install pip==24.0
pip install --upgrade setuptools
pip install -r requirements.txt
- name: Test with pytest
env:
DATABASE_URL: postgis://postgres:postgres@localhost:5432/lametro
SEARCH_URL: http://localhost:9200
run: |
cp .env.local.example .env.local
pytest -sv