Repository navigation
70 lines (65 loc) · 2.42 KB
/
Copy pathpython-app.yml
File metadata and controls
70 lines (65 loc) · 2.42 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
67
68
69
70
name: CI
on:
push:
branches: ["main"]
pull_request:
branches: ["main"]
permissions:
contents: read
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with: { python-version: "3.12", cache: pip }
- run: pip install -e . ruff mypy "pydantic>=2" fastapi "django>=4.2" grpcio
- run: ruff check aggify tests
- run: mypy aggify
test:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
mongo: ["6.0", "7.0", "8.0"]
exclude:
- { python-version: "3.10", mongo: "6.0" }
- { python-version: "3.11", mongo: "6.0" }
- { python-version: "3.9", mongo: "8.0" }
- { python-version: "3.10", mongo: "8.0" }
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with: { python-version: "${{ matrix.python-version }}", cache: pip }
- name: Start MongoDB ${{ matrix.mongo }} (single-node replica set)
run: |
docker run -d --name mongo -p 27017:27017 mongo:${{ matrix.mongo }} --replSet rs0 --bind_ip_all
for i in $(seq 1 30); do
docker exec mongo mongosh --quiet --eval 'db.runCommand({ping:1}).ok' >/dev/null 2>&1 && break
sleep 2
done
docker exec mongo mongosh --quiet --eval 'rs.initiate({_id:"rs0",members:[{_id:0,host:"localhost:27017"}]})'
for i in $(seq 1 30); do
docker exec mongo mongosh --quiet --eval 'db.hello().isWritablePrimary' | grep -q true && break
sleep 2
done
- name: Install
run: pip install -e . pytest pytest-asyncio pytest-cov hypothesis httpx "pydantic>=2" fastapi grpcio protobuf "django>=4.2"
- name: Test
env:
AGGIFY_TEST_MONGO_URI: mongodb://localhost:27017/?directConnection=true
run: pytest --cov=aggify --cov-report=xml
- uses: codecov/codecov-action@v4
if: matrix.python-version == '3.12' && matrix.mongo == '7.0'
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: coverage.xml
docs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with: { python-version: "3.12", cache: pip }
- run: pip install -e . mkdocs mkdocs-material "mkdocstrings[python]"
- run: mkdocs build --strict