Production Tests - Fly.io #712
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: Production Tests - Fly.io | |
| on: | |
| schedule: | |
| # Executar a cada 6 horas | |
| - cron: '0 */6 * * *' | |
| workflow_dispatch: | |
| inputs: | |
| test_mode: | |
| description: 'Modo de teste' | |
| required: true | |
| default: 'simple' | |
| type: choice | |
| options: | |
| - simple | |
| - complete | |
| - api | |
| - monitor | |
| jobs: | |
| test-production: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Setup Fly CLI | |
| uses: superfly/flyctl-actions/setup-flyctl@master | |
| - name: Run Simple Tests | |
| if: github.event.inputs.test_mode == 'simple' || github.event_name == 'schedule' | |
| run: | | |
| bash test-fly-simple.sh | |
| - name: Run Complete Tests | |
| if: github.event.inputs.test_mode == 'complete' | |
| run: | | |
| bash test-fly-production.sh | |
| - name: Run API Tests | |
| if: github.event.inputs.test_mode == 'api' | |
| run: | | |
| bash test-api-complete.sh | |
| - name: Monitor for 5 minutes | |
| if: github.event.inputs.test_mode == 'monitor' | |
| run: | | |
| timeout 300 bash monitor-fly-continuous.sh 30 || true | |
| - name: Upload logs | |
| if: always() | |
| uses: actions/upload-artifact@v3 | |
| with: | |
| name: test-logs | |
| path: | | |
| fly-monitoring.log | |
| PRODUCTION_TEST_REPORT.md | |
| - name: Notify on failure | |
| if: failure() | |
| uses: actions/github-script@v7 | |
| with: | |
| script: | | |
| github.rest.issues.createComment({ | |
| issue_number: context.issue.number, | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| body: '❌ Production tests failed! Check the logs.' | |
| }) | |
| health-check: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Check backend health | |
| run: | | |
| curl -f https://liquid-ai-backend.fly.dev/health || exit 1 | |
| - name: Check frontend | |
| run: | | |
| curl -f https://liquid-ai-frontend-new.fly.dev || exit 1 | |
| - name: Notify success | |
| if: success() | |
| run: | | |
| echo "✅ All health checks passed!" |