Integration Tests #20
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: Integration Tests | |
| on: | |
| workflow_dispatch: | |
| inputs: | |
| ai_tests: | |
| description: 'Enable AI-powered tests (requires ANTHROPIC_API_KEY)' | |
| required: false | |
| default: 'false' | |
| type: choice | |
| options: | |
| - 'false' | |
| - 'true' | |
| schedule: | |
| # Nightly at 2am UTC | |
| - cron: '0 2 * * *' | |
| concurrency: | |
| group: integration-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| integration: | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 30 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 22 | |
| - name: Setup pnpm | |
| uses: pnpm/action-setup@v4 | |
| with: | |
| version: 9 | |
| - name: Install dependencies | |
| run: pnpm install --frozen-lockfile | |
| - name: Start integration services | |
| run: docker compose -f docker-compose.integration.yml up -d | |
| - name: Wait for services to be healthy | |
| run: | | |
| echo "Waiting for Mission Control to be healthy..." | |
| for i in $(seq 1 60); do | |
| if curl -s http://localhost:3000/api/health | grep -q '"ok"'; then | |
| echo "Mission Control is healthy!" | |
| break | |
| fi | |
| echo "Attempt $i/60 - waiting..." | |
| sleep 5 | |
| done | |
| - name: Run integration tests | |
| env: | |
| TEST_BASE_URL: http://localhost:3000 | |
| AI_TESTS_ENABLED: ${{ github.event.inputs.ai_tests || 'false' }} | |
| ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }} | |
| run: pnpm test:integration:run | |
| - name: Show service logs on failure | |
| if: failure() | |
| run: docker compose -f docker-compose.integration.yml logs --tail=100 | |
| - name: Tear down services | |
| if: always() | |
| run: docker compose -f docker-compose.integration.yml down -v |