-
Notifications
You must be signed in to change notification settings - Fork 51
66 lines (55 loc) · 1.65 KB
/
Copy pathtest_backend.yml
File metadata and controls
66 lines (55 loc) · 1.65 KB
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: Run Pytest
on:
push:
pull_request:
jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.11, 3.13]
services:
postgres:
image: postgis/postgis:15-3.4
ports:
- 5432:5432
env:
POSTGRES_USER: geonatadmin
POSTGRES_PASSWORD: monpassachanger
POSTGRES_DB: geonatureatlas_test
options: >-
--health-cmd="pg_isready -U atlas -d atlas_test" --health-interval=10s
--health-timeout=5s --health-retries=5
env:
# Variable d'environnement pour ton app Flask
ATLAS_SETTINGS: ${{ github.workspace }}/atlas/tests/test_config.py
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
pip install -e ".[dev]"
- name: Create app structure
run: |
cp -r atlas/static/custom_sample/* atlas/static/custom
- name: Wait for PostgreSQL to be ready
run: |
for i in {1..10}; do
pg_isready -h localhost -p 5432 -U atlas && break
echo "Postgres not ready yet..."
sleep 2
done
- name: Run pytest
run: |
pytest -vv --cov --cov-branch --cov-report=xml
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
flags: pytest