-
Notifications
You must be signed in to change notification settings - Fork 0
100 lines (80 loc) · 2.29 KB
/
Copy pathci.yml
File metadata and controls
100 lines (80 loc) · 2.29 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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
name: CI
on:
push:
branches:
- main
- "codex/**"
pull_request:
branches: [main]
workflow_dispatch:
permissions:
contents: read
concurrency:
group: ci-${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
quality:
name: Quality and tests
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.11"
cache: pip
cache-dependency-path: |
requirements.txt
requirements-dev.txt
- name: Install development dependencies
run: |
python -m pip install --upgrade pip
python -m pip install -r requirements-dev.txt
- name: Prepare CI inputs
run: python -m scripts.prepare_ci
- name: Dependency check
run: python -m pip check
- name: Ruff lint
run: python -m ruff check src scripts tests
- name: Ruff format
run: python -m ruff format --check src scripts tests
- name: Compile source and tests
run: python -m compileall -q src scripts tests
- name: Run test suite
env:
PYTEST_DISABLE_PLUGIN_AUTOLOAD: "1"
run: python -m pytest -q
docker-smoke:
name: Docker smoke test
needs: quality
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Build image
run: docker build -t banking77-router:test .
- name: Start container
run: docker run -d --name banking77-router -p 8000:8000 banking77-router:test
- name: Wait for readiness
run: |
for i in {1..20}; do
if curl --fail http://127.0.0.1:8000/health/ready; then
exit 0
fi
sleep 2
done
docker logs banking77-router
exit 1
- name: Route smoke test
run: |
curl --fail \
-X POST \
http://127.0.0.1:8000/v1/route \
-H "Content-Type: application/json" \
-d '{"text":"Why was my cash withdrawal declined?","top_k":3}'
- name: Cleanup
if: always()
run: docker rm -f banking77-router || true