Refactor to Vue 3 + FastAPI + SQLite architecture
Some checks failed
Some checks failed
- Backend: FastAPI + SQLite (WAL mode), 22 tables, ~40 API endpoints - Frontend: Vue 3 + Vite + Pinia + Vue Router, 8 views, 3 stores - Database: migrate from JSON file to SQLite with proper schema - Dockerfile: multi-stage build (node + python) - Deploy: K8s manifests (namespace, deployment, service, ingress, pvc, backup) - CI/CD: Gitea Actions (test, deploy, PR preview at pr-$id.planner.oci.euphon.net) - Tests: 20 Cypress E2E test files, 196 test cases, ~85% coverage - Doc: test-coverage.md with full feature coverage report Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
20
.gitea/workflows/deploy.yml
Normal file
20
.gitea/workflows/deploy.yml
Normal file
@@ -0,0 +1,20 @@
|
||||
name: Deploy Production
|
||||
on:
|
||||
push:
|
||||
branches: [main]
|
||||
|
||||
jobs:
|
||||
test:
|
||||
runs-on: test
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- name: Build check
|
||||
run: cd frontend && npm ci && npm run build
|
||||
|
||||
deploy:
|
||||
needs: test
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- name: Deploy Production
|
||||
run: python3 scripts/deploy-preview.py deploy-prod
|
||||
50
.gitea/workflows/preview.yml
Normal file
50
.gitea/workflows/preview.yml
Normal file
@@ -0,0 +1,50 @@
|
||||
name: PR Preview
|
||||
on:
|
||||
pull_request:
|
||||
types: [opened, synchronize, reopened, closed]
|
||||
|
||||
jobs:
|
||||
test:
|
||||
if: github.event.action != 'closed'
|
||||
runs-on: test
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- name: Build check
|
||||
run: cd frontend && npm ci && npm run build
|
||||
|
||||
deploy-preview:
|
||||
if: github.event.action != 'closed'
|
||||
needs: test
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- name: Deploy Preview
|
||||
run: python3 scripts/deploy-preview.py deploy ${{ github.event.pull_request.number }}
|
||||
- name: Comment PR
|
||||
env:
|
||||
GIT_TOKEN: ${{ secrets.GIT_TOKEN }}
|
||||
run: |
|
||||
PR_ID="${{ github.event.pull_request.number }}"
|
||||
curl -sf -X POST \
|
||||
"https://git.euphon.cloud/api/v1/repos/${{ github.repository }}/issues/${PR_ID}/comments" \
|
||||
-H "Authorization: token ${GIT_TOKEN}" \
|
||||
-H "Content-Type: application/json" \
|
||||
-d "{\"body\": \"🚀 **Preview**: https://pr-${PR_ID}.planner.oci.euphon.net\n\nDB is a copy of production.\"}" || true
|
||||
|
||||
teardown-preview:
|
||||
if: github.event.action == 'closed'
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- name: Teardown
|
||||
run: python3 scripts/deploy-preview.py teardown ${{ github.event.pull_request.number }}
|
||||
- name: Comment PR
|
||||
env:
|
||||
GIT_TOKEN: ${{ secrets.GIT_TOKEN }}
|
||||
run: |
|
||||
PR_ID="${{ github.event.pull_request.number }}"
|
||||
curl -sf -X POST \
|
||||
"https://git.euphon.cloud/api/v1/repos/${{ github.repository }}/issues/${PR_ID}/comments" \
|
||||
-H "Authorization: token ${GIT_TOKEN}" \
|
||||
-H "Content-Type: application/json" \
|
||||
-d "{\"body\": \"🗑️ Preview torn down.\"}" || true
|
||||
62
.gitea/workflows/test.yml
Normal file
62
.gitea/workflows/test.yml
Normal file
@@ -0,0 +1,62 @@
|
||||
name: Test
|
||||
on: [push]
|
||||
|
||||
jobs:
|
||||
build-check:
|
||||
runs-on: test
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- name: Build frontend
|
||||
run: cd frontend && npm ci && npm run build
|
||||
|
||||
e2e-test:
|
||||
runs-on: test
|
||||
needs: build-check
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Install frontend deps
|
||||
run: cd frontend && npm ci
|
||||
|
||||
- name: Install backend deps
|
||||
run: python3 -m venv /tmp/ci-venv && /tmp/ci-venv/bin/pip install -q -r backend/requirements.txt
|
||||
|
||||
- name: E2E tests
|
||||
run: |
|
||||
# Start backend
|
||||
DB_PATH=/tmp/ci_planner_test.db FRONTEND_DIR=/dev/null DATA_DIR=/tmp/ci_planner_data \
|
||||
/tmp/ci-venv/bin/uvicorn backend.main:app --port 8000 &
|
||||
|
||||
# Start frontend
|
||||
(cd frontend && npx vite --port 5173) &
|
||||
|
||||
# Wait for both servers
|
||||
for i in $(seq 1 30); do
|
||||
if curl -sf http://localhost:8000/api/backups > /dev/null 2>&1 && \
|
||||
curl -sf http://localhost:5173/ > /dev/null 2>&1; then
|
||||
echo "Both servers ready"
|
||||
break
|
||||
fi
|
||||
sleep 1
|
||||
done
|
||||
|
||||
# Run core cypress specs
|
||||
cd frontend
|
||||
npx cypress run --spec "\
|
||||
cypress/e2e/app-load.cy.js,\
|
||||
cypress/e2e/auth-flow.cy.js,\
|
||||
cypress/e2e/navigation.cy.js,\
|
||||
cypress/e2e/api-health.cy.js,\
|
||||
cypress/e2e/api-crud.cy.js,\
|
||||
cypress/e2e/notes-flow.cy.js,\
|
||||
cypress/e2e/tasks-flow.cy.js,\
|
||||
cypress/e2e/reminders-flow.cy.js\
|
||||
" --config video=false
|
||||
EXIT_CODE=$?
|
||||
|
||||
# Cleanup
|
||||
pkill -f "uvicorn backend" || true
|
||||
pkill -f "node.*vite" || true
|
||||
rm -f /tmp/ci_planner_test.db
|
||||
rm -rf /tmp/ci_planner_data
|
||||
exit $EXIT_CODE
|
||||
Reference in New Issue
Block a user