Change link color, add JS shim for dropdown selection, add aria for tabs #19
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 - Build and Smoke Test | |
| on: | |
| push: | |
| pull_request: | |
| jobs: | |
| build-and-smoke-test: | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 30 | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| - name: Build Docker image | |
| run: | | |
| docker build -t orfeus-app-ci:${{ github.sha }} . | |
| - name: Run container | |
| run: | | |
| docker run -d \ | |
| --name orfeus-app \ | |
| -e PORT=8055 \ | |
| -e STUB_MODE=1 \ | |
| -e PYTHONUNBUFFERED=1 \ | |
| -p 8055:8055 \ | |
| orfeus-app-ci:${{ github.sha }} | |
| - name: Wait for service readiness | |
| run: | | |
| set -e | |
| echo "Waiting for app to become healthy (up to ~2 minutes)..." | |
| for i in {1..60}; do | |
| # if container has exited, dump diagnostics and fail fast | |
| if ! docker ps --format '{{.Names}}' | grep -q '^orfeus-app$'; then | |
| echo "Container 'orfeus-app' is not running. Dumping diagnostics..." >&2 | |
| docker ps -a || true | |
| docker logs orfeus-app || true | |
| exit 1 | |
| fi | |
| # Try health endpoint first, then fallback to home page | |
| code=$(curl -s -o /dev/null -w "%{http_code}" http://localhost:8055/healthz || true) | |
| if [ "$code" = "200" ]; then | |
| echo "Service is healthy (healthz)." | |
| exit 0 | |
| fi | |
| code_home=$(curl -s -o /dev/null -w "%{http_code}" http://localhost:8055/ || true) | |
| if [ "$code_home" = "200" ]; then | |
| echo "Service is responding on /. Proceeding." | |
| exit 0 | |
| fi | |
| sleep 2 | |
| done | |
| echo "Service failed to become healthy in time. Dumping diagnostics..." >&2 | |
| docker ps -a || true | |
| docker logs orfeus-app || true | |
| exit 1 | |
| - name: Smoke test routes | |
| run: | | |
| set -e | |
| routes=( | |
| "/" | |
| "/scenariovisualize" | |
| "/riskallocplot" | |
| "/lmpplot" | |
| ) | |
| base="http://localhost:8055" | |
| for r in "${routes[@]}"; do | |
| url="$base$r" | |
| echo "Testing $url" | |
| code=$(curl -s -o /dev/null -w "%{http_code}" "$url" || true) | |
| if [ "$code" != "200" ]; then | |
| echo "Non-200 status for $url: $code" >&2 | |
| docker logs orfeus-app || true | |
| exit 1 | |
| fi | |
| done | |
| - name: Check container logs for errors | |
| run: | | |
| docker logs orfeus-app > app.log || true | |
| echo "--- Tail of app.log ---" | |
| tail -n 200 app.log || true | |
| # Fail the build on common error signatures | |
| if grep -Ei "(Traceback|CRITICAL|Unhandled exception|ERROR in app|ValueError|KeyError)" app.log; then | |
| echo "Detected errors in application logs." >&2 | |
| exit 1 | |
| fi | |
| - name: Upload app logs | |
| if: always() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: app-logs | |
| path: app.log | |
| - name: Stop container | |
| if: always() | |
| run: | | |
| docker rm -f orfeus-app >/dev/null 2>&1 || true |