Some major Bugfixes #61
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: Build and Test | |
| on: | |
| push: | |
| branches: [main, develop] | |
| pull_request: | |
| branches: [main, develop] | |
| workflow_dispatch: | |
| jobs: | |
| frontend-build: | |
| name: Frontend Build Check | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: "22.14.0" | |
| cache: "npm" | |
| cache-dependency-path: frontend/package-lock.json | |
| - name: Install frontend dependencies | |
| working-directory: ./frontend | |
| run: npm ci | |
| - name: Build Angular project | |
| working-directory: ./frontend | |
| # Note: Using --optimization=false to avoid font inlining network issues in CI | |
| # This ensures reliable builds in restricted network environments | |
| run: npm run build -- --optimization=false | |
| - name: Check build artifacts | |
| working-directory: ./frontend | |
| run: | | |
| if [ ! -d "dist/join" ]; then | |
| echo "Build failed: dist/join directory not found" | |
| exit 1 | |
| fi | |
| echo "Frontend build successful!" | |
| backend-test: | |
| name: Backend API Test | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Setup Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.10" | |
| cache: "pip" | |
| cache-dependency-path: backend/requirements.txt | |
| - name: Install backend dependencies | |
| working-directory: ./backend | |
| run: | | |
| pip install -r requirements.txt | |
| - name: Run database migrations | |
| working-directory: ./backend | |
| run: | | |
| python manage.py migrate | |
| - name: Start Django test server | |
| working-directory: ./backend | |
| run: | | |
| python manage.py runserver 0.0.0.0:8000 & | |
| SERVER_PID=$! | |
| echo "SERVER_PID=$SERVER_PID" >> $GITHUB_ENV | |
| echo "Django server started with PID: $SERVER_PID" | |
| - name: Wait for server to start | |
| run: | | |
| echo "Waiting for Django server to be ready..." | |
| for i in {1..30}; do | |
| if curl -s http://localhost:8000/api/v1/auth/users/ > /dev/null 2>&1; then | |
| echo "Server is ready!" | |
| exit 0 | |
| fi | |
| sleep 1 | |
| done | |
| echo "Server failed to start within 30 seconds" | |
| exit 1 | |
| - name: Test API endpoints | |
| run: | | |
| echo "Testing backend API endpoints..." | |
| # Test admin endpoint (should redirect) | |
| echo "Testing /admin/ endpoint..." | |
| HTTP_CODE=$(curl -s -o /dev/null -w "%{http_code}" http://localhost:8000/admin/) | |
| if [[ "$HTTP_CODE" =~ ^(200|302)$ ]]; then | |
| echo "✓ Admin endpoint accessible (HTTP $HTTP_CODE)" | |
| else | |
| echo "Failed to reach /admin/ (HTTP $HTTP_CODE)" | |
| exit 1 | |
| fi | |
| # Test auth endpoints | |
| echo "Testing /api/v1/auth/users/ endpoint..." | |
| if curl -sf http://localhost:8000/api/v1/auth/users/ > /dev/null; then | |
| echo "✓ Auth users endpoint accessible" | |
| else | |
| echo "Failed to reach /api/v1/auth/users/" | |
| exit 1 | |
| fi | |
| # Test task endpoint | |
| echo "Testing /api/v1/task/ endpoint..." | |
| if curl -sf http://localhost:8000/api/v1/task/ > /dev/null; then | |
| echo "✓ Task endpoint accessible" | |
| else | |
| echo "Failed to reach /api/v1/task/" | |
| exit 1 | |
| fi | |
| # Test contact endpoint | |
| echo "Testing /api/v1/contact/ endpoint..." | |
| if curl -sf http://localhost:8000/api/v1/contact/ > /dev/null; then | |
| echo "✓ Contact endpoint accessible" | |
| else | |
| echo "Failed to reach /api/v1/contact/" | |
| exit 1 | |
| fi | |
| echo "" | |
| echo "All endpoint tests passed!" | |
| - name: Stop Django server | |
| if: always() | |
| run: | | |
| if [[ -n "$SERVER_PID" ]]; then | |
| kill "$SERVER_PID" || true | |
| echo "Django server stopped" | |
| fi |