Claude
Add CI workflow
d704a4f unverified
Raw History Blame Contribute Delete
1.3 kB
name: CI
on: [push, pull_request]
jobs:
tests:
name: Unit + HTTP smoke
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.12"
cache: pip
- name: Install QPDF (for pikepdf) and dependencies
run: |
sudo apt-get update
sudo apt-get install -y --no-install-recommends qpdf
pip install -r requirements.txt
- name: Acronym regression tests
run: python tests/test_acronyms.py
- name: Start app
run: |
uvicorn backend.app.main:app --host 127.0.0.1 --port 8000 &
echo $! > /tmp/uvicorn.pid
for i in $(seq 1 30); do
curl -fs http://127.0.0.1:8000/api/health >/dev/null && exit 0
sleep 1
done
echo "app failed to start"; exit 1
- name: HTTP smoke test
run: bash scripts/smoke_test.sh http://127.0.0.1:8000
- name: Stop app
if: always()
run: kill "$(cat /tmp/uvicorn.pid)" 2>/dev/null || true
docker:
name: Docker image smoke
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Build image, run container, smoke test
run: bash scripts/docker_smoke.sh