-
Notifications
You must be signed in to change notification settings - Fork 86
85 lines (81 loc) · 2.57 KB
/
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
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
name: Froide CI
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install pnpm
uses: pnpm/action-setup@v4
with:
version: 9
- uses: actions/setup-node@v4
with:
node-version: 20
cache: 'pnpm'
- name: Install dependencies
run: pnpm install
- uses: pre-commit/[email protected]
test:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.10', '3.12']
steps:
- uses: actions/checkout@v4
- name: Setup uv
uses: astral-sh/setup-uv@v2
with:
enable-cache: true
cache-dependency-glob: |
requirements*.txt
pyproject.toml
- name: Install pnpm
uses: pnpm/action-setup@v4
with:
version: 9
- uses: actions/setup-node@v4
with:
node-version: 20
cache: 'pnpm'
- name: Install system-level dependencies
run: sudo apt-get update && sudo apt-get install libxml2-dev libxslt1-dev libgdal-dev gdal-bin libmagic-dev libmagickwand-dev libpoppler-cpp-dev
- name: Setup venv
run: |
uv venv --python ${{ matrix.python-version }}
source .venv/bin/activate
echo PATH=$PATH >> $GITHUB_ENV
- name: Install dependencies
run: |
uv pip sync requirements-test.txt
uv pip install -e . --no-deps
playwright install --with-deps chromium
pnpm install
- name: Build frontend
run: pnpm run build
- name: Run tests
run: |
coverage run --branch -m pytest froide/
coverage report --format=markdown >> $GITHUB_STEP_SUMMARY
env:
DATABASE_URL: postgis://postgres:postgres@localhost/froide
services:
postgres:
image: postgis/postgis:16-3.4
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: froide
ports:
- 5432:5432
# needed because the postgres container does not provide a healthcheck
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
elasticsearch:
image: docker.elastic.co/elasticsearch/elasticsearch:8.11.3
options: -e "discovery.type=single-node" -e "xpack.security.enabled=false" --expose 9200 --health-cmd "curl localhost:9200/_cluster/health" --health-interval 10s --health-timeout 5s --health-retries 10
ports:
- '9200:9200'