-
Notifications
You must be signed in to change notification settings - Fork 0
74 lines (60 loc) · 2.03 KB
/
Copy pathci.yml
File metadata and controls
74 lines (60 loc) · 2.03 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
71
72
73
74
name: CI
# Reproducible builds gate: lint + tests on every push/PR, then a Docker image
# build with a container smoke test. Week 3 (Docker Platform).
on:
push:
branches: [main]
pull_request:
concurrency:
group: ci-${{ github.ref }}
cancel-in-progress: true
jobs:
lint-test:
name: Lint & test (CPU / mock)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.12"
cache: pip
cache-dependency-path: requirements-dev.txt
- name: Install dev dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements-dev.txt
- name: Lint (ruff)
run: ruff check .
- name: Test (pytest, mock backend)
run: pytest -q
docker-cpu:
name: Build CPU image & smoke test
runs-on: ubuntu-latest
needs: lint-test
steps:
- uses: actions/checkout@v4
# Mock-only image (INCLUDE_HF=0): no torch download, so CI stays fast.
- name: Build CPU image
run: |
docker build -f deployment/docker/Dockerfile.cpu \
--build-arg INCLUDE_HF=0 -t atlasai:ci .
- name: Run container
run: docker run -d --name atlasai -p 8000:8000 atlasai:ci
- name: Smoke test /health and /ready
run: |
for i in $(seq 1 30); do
if curl -fsS http://localhost:8000/health >/dev/null; then
echo "gateway up"; break
fi
sleep 2
done
# /health must report ok; /ready must report the active mock backend
# (the mock engine loads instantly, so readiness should be 200).
curl -fsS http://localhost:8000/health | tee /dev/stderr | grep -q '"status":"ok"'
curl -fsS http://localhost:8000/ready | tee /dev/stderr | grep -q '"backend":"mock"'
- name: Container logs
if: always()
run: docker logs atlasai || true
- name: Teardown
if: always()
run: docker rm -f atlasai || true