remove the trailing comma in replay.py and enhanced the auth.py #128
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 Pipeline | |
| on: | |
| push: | |
| branches: [main, develop] | |
| pull_request: | |
| branches: [main, develop] | |
| jobs: | |
| infra-check: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| # ------------------------------- | |
| # BUILD & START SERVICES | |
| # ------------------------------- | |
| - name: Build and start services | |
| run: docker compose up -d --build postgres redis api | |
| - name: Wait for services | |
| run: sleep 10 | |
| # ------------------------------- | |
| # BASIC HEALTH CHECKS | |
| # ------------------------------- | |
| - name: Check API health | |
| run: curl -f http://localhost:3001/health | |
| - name: Verify Postgres | |
| run: docker exec hooktrace-db pg_isready -U hooktrace | |
| - name: Verify Redis | |
| run: docker exec hooktrace-redis redis-cli ping | |
| # ------------------------------- | |
| # BASIC AUTH FLOW TEST | |
| # ------------------------------- | |
| - name: Register user | |
| run: | | |
| curl -f -X POST http://localhost:3001/auth/register \ | |
| -H "Content-Type: application/json" \ | |
| -d '{"email":"ci@example.com","password":"ci_test_pass"}' | |
| - name: Login user | |
| run: | | |
| RESP=$(curl -s -X POST http://localhost:3001/auth/login \ | |
| -H "Content-Type: application/json" \ | |
| -d '{"email":"ci@example.com","password":"ci_test_pass"}') | |
| echo "Login response: $RESP" | |
| TOKEN=$(echo $RESP | python3 -c "import sys,json; print(json.load(sys.stdin).get('access_token',''))") | |
| if [ -z "$TOKEN" ]; then | |
| echo " Login failed" | |
| exit 1 | |
| fi | |
| # ------------------------------- | |
| # DEBUG (ONLY ON FAILURE) | |
| # ------------------------------- | |
| - name: Show logs on failure | |
| if: failure() | |
| run: | | |
| docker logs hooktrace-api || true | |
| docker logs hooktrace-db || true | |
| docker logs hooktrace-redis || true | |
| - name: Stop services | |
| if: always() | |
| run: docker compose down -v |