75 lines
2.3 KiB
YAML
75 lines
2.3 KiB
YAML
name: Test Suite
|
|
|
|
on:
|
|
push:
|
|
branches: [develop]
|
|
workflow_run:
|
|
workflows: ["Deploy Development"]
|
|
types: [completed]
|
|
workflow_dispatch:
|
|
|
|
jobs:
|
|
pytest-backend:
|
|
if: ${{ github.event_name != 'workflow_run' || github.event.workflow_run.conclusion == 'success' }}
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: pytest against Dev Postgres (buyingagent_test)
|
|
run: |
|
|
set -e
|
|
APP_DIR="$HOME/docker/buyingagent-dev"
|
|
echo "pytest uses Dev Postgres (${APP_DIR}); event=${{ github.event_name }}"
|
|
cd "$APP_DIR"
|
|
for i in $(seq 1 60); do
|
|
if [ -f scripts/ci-pytest.sh ]; then
|
|
echo "ci-pytest.sh ready (attempt $i)"
|
|
break
|
|
fi
|
|
if [ "$i" -eq 60 ]; then
|
|
echo "timeout waiting for scripts/ci-pytest.sh after Dev deploy"
|
|
ls -la scripts || true
|
|
exit 1
|
|
fi
|
|
sleep 5
|
|
done
|
|
sh scripts/ci-pytest.sh
|
|
|
|
smoke-dev:
|
|
if: ${{ github.event_name != 'workflow_run' || github.event.workflow_run.conclusion == 'success' }}
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Non-destructive smoke against the running Dev API
|
|
run: |
|
|
set -e
|
|
echo "live Dev API (buyingagent-dev), read-only health"
|
|
for i in $(seq 1 60); do
|
|
if curl -sf http://localhost:8095/health/live >/dev/null; then
|
|
echo "DEV /health/live ready (attempt $i)"
|
|
break
|
|
fi
|
|
if [ "$i" -eq 60 ]; then
|
|
echo "timeout waiting for DEV /health/live"
|
|
exit 1
|
|
fi
|
|
sleep 5
|
|
done
|
|
curl -sf http://localhost:8095/health/live
|
|
echo
|
|
curl -sf http://localhost:8095/health/ready
|
|
echo
|
|
echo "LAN smoke OK: http://192.168.2.49:8095"
|
|
|
|
frontend-checks:
|
|
if: ${{ github.event_name != 'workflow_run' || github.event.workflow_run.conclusion == 'success' }}
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Frontend typecheck, lint, test, build
|
|
run: |
|
|
set -e
|
|
APP_DIR="$HOME/docker/buyingagent-dev"
|
|
cd "$APP_DIR/frontend"
|
|
npm ci || npm install
|
|
npm run typecheck
|
|
npm run lint
|
|
npm test
|
|
npm run build
|