Repository navigation
65 lines (52 loc) · 1.7 KB
/
Copy pathci.yml
File metadata and controls
65 lines (52 loc) · 1.7 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
name: CI
on:
push:
branches: [main]
pull_request:
branches: [main]
permissions:
contents: read
jobs:
test:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.10", "3.11", "3.12", "3.13"]
services:
mongo:
image: mongo:7
ports:
- 27017:27017
# Wait until mongo is ready before the job tries to connect.
options: >-
--health-cmd "mongosh --quiet --eval 'db.runCommand({ ping: 1 }).ok'"
--health-interval 5s
--health-timeout 5s
--health-retries 12
env:
# The DB-backed tests need this; SolisCloud creds are not needed because
# tests mock the upstream via httpx.MockTransport.
SOLIS_MONGODB_URI: mongodb://localhost:27017
SOLIS_MONGODB_DB: solis_ci
SESSION_SECRET: ci-only-session-secret
# Stop the scheduler from starting (it never would in tests, but make
# the intent explicit).
RUN_SCHEDULER: "false"
steps:
- uses: actions/checkout@v4
- name: Install uv
uses: astral-sh/setup-uv@v6
with:
enable-cache: true
cache-dependency-glob: "uv.lock"
- name: Set up Python ${{ matrix.python-version }}
run: uv python install ${{ matrix.python-version }}
- name: Install dependencies
run: uv sync --extra dev --python ${{ matrix.python-version }}
- name: Ruff
run: uv run --python ${{ matrix.python-version }} python -m ruff check .
- name: Mypy
run: uv run --python ${{ matrix.python-version }} python -m mypy
- name: Pytest
run: uv run --python ${{ matrix.python-version }} python -m pytest -n auto -v