Standardize repository structure and add Pages #7
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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":"latticeiq_demo_sales.xlsx"}' | grep -q "Analysis Plan" | |
| - 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]" |