-
Notifications
You must be signed in to change notification settings - Fork 0
95 lines (80 loc) · 2.67 KB
/
Copy pathci.yml
File metadata and controls
95 lines (80 loc) · 2.67 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
name: CI
on:
push:
branches:
- main
pull_request:
jobs:
analysis-service:
name: Analysis service tests
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.11"
- name: Install dependencies
run: python -m pip install -r analysis_service/requirements-dev.txt
- name: Run tests
env:
PYTHONPATH: ${{ github.workspace }}/analysis_service
run: python -m pytest -q analysis_service/tests
docker-build:
name: Docker build
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Build analysis service image
run: docker compose build
api-smoke:
name: API smoke test
runs-on: ubuntu-latest
needs: docker-build
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Start analysis service
run: docker compose up -d --build
- name: Wait for health
run: |
for i in {1..30}; do
if curl -fsS http://127.0.0.1:8000/health; then
exit 0
fi
sleep 2
done
docker compose logs
exit 1
- name: Exercise upload and report endpoints
run: |
curl -fsS -X POST http://127.0.0.1:8000/api/analyze-upload \
-F "file=@analysis_service/tests/fixtures/mixed_schema_sample.csv" | tee /tmp/profile.json
grep -q "analysis_plan" /tmp/profile.json
curl -fsS -X POST http://127.0.0.1:8000/api/report/markdown \
-H "Content-Type: application/json" \
-d '{"filename":"tablepilot_demo_sales.xlsx"}' | grep -q "Analysis Plan"
curl -fsS -X POST http://127.0.0.1:8000/api/report/html \
-H "Content-Type: application/json" \
-d '{"filename":"tablepilot_demo_sales.xlsx"}' | grep -q "TablePilot Analysis Report"
curl -fsS -X POST http://127.0.0.1:8000/api/session/export \
-H "Content-Type: application/json" \
-d '{"filename":"multi_sheet_operations.xlsx","sheet":"Detail"}' | grep -q "customer_segment"
- name: Stop service
if: always()
run: docker compose down
package-metadata:
name: Python package metadata
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.11"
- name: Validate package metadata
working-directory: analysis_service
run: python -m pip install -e ".[dev]"