-
Notifications
You must be signed in to change notification settings - Fork 0
54 lines (42 loc) · 1.28 KB
/
Copy pathci.yml
File metadata and controls
54 lines (42 loc) · 1.28 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
name: CI
on:
push:
branches: [main]
pull_request:
jobs:
lint-and-test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Install uv
# setup-uv has no moving major tag past v7; pin the latest release.
uses: astral-sh/setup-uv@v8.2.0
with:
enable-cache: true
- name: Install dependencies
run: uv sync --group dev
- name: Check formatting (ruff)
run: uv run ruff format --check .
- name: Run tests
run: uv run pytest
docker-build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Create .env from template
run: cp .env.example .env
- name: Build images
run: docker compose build
- name: Start postgres + api
run: docker compose up -d postgres api
- name: Smoke test /api/v1/status
run: |
for i in $(seq 1 30); do
code=$(curl -s -o /dev/null -w '%{http_code}' http://localhost:5000/api/v1/status || true)
if [ "$code" = "200" ]; then echo "status 200 (attempt $i)"; exit 0; fi
sleep 3
done
echo "API never returned 200"; docker compose logs; exit 1
- name: Tear down
if: always()
run: docker compose down -v