-
Notifications
You must be signed in to change notification settings - Fork 1
89 lines (77 loc) · 2.4 KB
/
test-ubuntu.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
name: tests
on:
pull_request:
branches:
- master
paths-ignore:
- ".gitignore"
- "**.md"
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-20.04
services:
postgres:
image: kartoza/postgis:14
env:
POSTGRES_USER: admin
POSTGRES_PASS: admin
POSTGRES_DB: gis_test
ALLOW_IP_RANGE: 0.0.0.0/0
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 5432:5432
redis:
image: redis:6.2
options: >-
--health-cmd "redis-cli ping"
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 6379:6379
steps:
- uses: actions/checkout@v2
- name: Set up Python 3.12
uses: actions/setup-python@v2
with:
python-version: "3.12"
- name: Install and set up Poetry
run: |
curl -sSL https://install.python-poetry.org | python
$HOME/.local/bin/poetry config virtualenvs.in-project true
- name: Cache dependencies.py
uses: actions/cache@v2
with:
path: .venv
key: venv-3.12-${{ hashFiles('**/poetry.lock') }}
- name: Install dependencies.py
run: |
$HOME/.local/bin/poetry install
- name: Install osmium & osmctools
run: |
sudo apt-get update
sudo apt-get install -y -qq osmium-tool osmctools
echo $(osmium --version)
- name: linting
run: |
source .venv/bin/activate
pre-commit run --all-files
- name: pytest and coverage
run: |
source .venv/bin/activate
sudo python -m smtpd -n -c DebuggingServer localhost:1025 &
sudo docker volume create routing-packager_packages --driver local --opt type=none --opt device=$PWD --opt o=bind &
sudo docker volume create routing-packager_tmp_data --driver local --opt type=none --opt device=$PWD --opt o=bind
export API_CONFIG=test
pytest --cov=routing_packager_app --ignore=tests/test_tasks.py
coverage lcov --include "routing_packager_app/*"
- name: coveralls
uses: coverallsapp/github-action@master
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
path-to-lcov: ./coverage.lcov