Files
app/.gitea/workflows/magnitude.yml
Albert a8da8753f1 feat: Add CI testing infrastructure with act_runner support
- Created scripts/test-ci-locally.sh to test Gitea Actions workflows locally using act_runner
- Created docker-compose.ci.yml for containerized CI test environment
- Updated .gitea/workflows/magnitude.yml to use docker-compose for CI
- Added scripts/README.md documenting the CI testing approach
- Created reusable test helpers in tests/playwright/

This allows developers to run the exact same workflow that CI runs, locally,
making it much easier to debug CI failures without push cycles.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-10 14:07:16 +00:00

64 lines
2.0 KiB
YAML

# Gitea Actions workflow for running Magnitude tests
# Uses docker-compose.ci.yml for fully containerized testing
name: Magnitude Tests
on:
push:
branches: [main, development]
pull_request:
branches: [main, development]
jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Create .env file for CI
run: |
cat > .env << EOF
SURREALDB_URL=ws://surrealdb:8000/rpc
SURREALDB_USER=root
SURREALDB_PASS=root
SURREALDB_NS=ponderants
SURREALDB_DB=main
ATPROTO_CLIENT_ID=${{ secrets.ATPROTO_CLIENT_ID }}
ATPROTO_REDIRECT_URI=${{ secrets.ATPROTO_REDIRECT_URI }}
GOOGLE_API_KEY=${{ secrets.GOOGLE_API_KEY }}
DEEPGRAM_API_KEY=${{ secrets.DEEPGRAM_API_KEY }}
SURREAL_JWT_SECRET=${{ secrets.SURREAL_JWT_SECRET }}
TEST_BLUESKY_HANDLE=${{ secrets.TEST_BLUESKY_HANDLE }}
TEST_BLUESKY_PASSWORD=${{ secrets.TEST_BLUESKY_PASSWORD }}
ANTHROPIC_API_KEY=${{ secrets.ANTHROPIC_API_KEY }}
EOF
- name: Run tests with docker-compose
run: |
docker compose -f docker-compose.ci.yml --profile test up \
--abort-on-container-exit \
--exit-code-from magnitude
- name: Show logs on failure
if: failure()
run: |
echo "=== SurrealDB Logs ==="
docker compose -f docker-compose.ci.yml logs surrealdb
echo "=== Next.js Logs ==="
docker compose -f docker-compose.ci.yml logs nextjs
echo "=== Magnitude Logs ==="
docker compose -f docker-compose.ci.yml logs magnitude
- name: Upload test results
if: always()
uses: actions/upload-artifact@v4
with:
name: magnitude-results
path: test-results/
retention-days: 30
- name: Cleanup
if: always()
run: docker compose -f docker-compose.ci.yml down -v