-
Notifications
You must be signed in to change notification settings - Fork 2
55 lines (45 loc) · 1.32 KB
/
test.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
name: Tests
on:
push:
branches:
- main
pull_request:
jobs:
test:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.9", "3.10", "3.11", "3.12"]
steps:
# check-out repo and set-up python
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
id: setup-python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
# Setup services with docker compose
- name: Setup env config
run: |
cp .env.example .env
sed -i 's/GEOSERVER_HOST=localhost/GEOSERVER_HOST=127.0.0.1/' .env
sed -i 's/POSTGRES_HOST=localhost/POSTGRES_HOST=127.0.0.1/' .env
- name: Setup docker
run: sudo apt install docker-compose
- name: Start services
run: docker-compose up -d
# Install & configure poetry
- name: Setup python environment
run: |
sudo apt install pipx
pipx ensurepath
pipx install poetry
poetry install
- name: Run tests
run: poetry run python -m pytest tests/ --cov --cov-report=xml
- name: Upload coverage
uses: codecov/codecov-action@v2
with:
fail_ci_if_error: false