Repository navigation
release: publish GitHub Release and GHCR package #46
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: Continuous Integration & Telemetry | |
| on: | |
| push: | |
| branches: [ main ] | |
| pull_request: | |
| branches: [ main ] | |
| jobs: | |
| engine-test: | |
| name: Model & Sequence Test Matrix | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: ⬇️ Checkout Repository | |
| uses: actions/checkout@v4 | |
| - name: 🐍 Set up Python Environment | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.11' | |
| cache: 'pip' # Automated caching for heavy deep learning packages | |
| - name: 📦 Install Package Dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| if [ -f requirements.txt ]; then pip install -r requirements.txt; fi | |
| pip install pytest pytest-cov | |
| - name: 🧪 Execute Recommender Test Suite | |
| run: | | |
| pytest --cov=app --cov=src --cov-report=term-missing --cov-report=xml --cov-fail-under=85 tests/ | |
| - name: 📎 Upload test evidence | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: test-evidence | |
| path: coverage.xml | |
| container-smoke: | |
| name: Verified Bundle Container Smoke Test | |
| runs-on: ubuntu-latest | |
| needs: engine-test | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.11' | |
| cache: pip | |
| - name: Build a pipeline-validation bundle | |
| run: | | |
| pip install -r requirements.txt | |
| python -m scripts.generate_demo_data --output data/ci-events.jsonl | |
| python -m src.training.train --dataset data/ci-events.jsonl --output models/current --epochs 1 --top-k 5 | |
| - name: Build and verify the production image | |
| run: | | |
| docker build -t deepsequence:${{ github.sha }} . | |
| docker run -d --rm --name deepsequence-ci --read-only --tmpfs /tmp \ | |
| -e API_KEY=ci-test-key \ | |
| -v "${PWD}/models/current:/models/current:ro" \ | |
| -p 8000:8000 deepsequence:${{ github.sha }} | |
| trap 'docker logs deepsequence-ci || true; docker stop deepsequence-ci >/dev/null 2>&1 || true' EXIT | |
| for attempt in {1..30}; do | |
| if curl --fail --silent http://127.0.0.1:8000/recommendations/health | grep '"trained_model":true'; then | |
| exit 0 | |
| fi | |
| sleep 2 | |
| done | |
| exit 1 |