Scheduled Testing #110
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: Scheduled Testing | |
| on: | |
| schedule: | |
| # Run daily at 6 AM UTC | |
| - cron: '0 6 * * *' | |
| workflow_dispatch: # Allow manual trigger | |
| env: | |
| PYTHON_VERSION: 3.11 | |
| jobs: | |
| scheduled-tests: | |
| runs-on: ubuntu-latest | |
| name: Daily Test Suite | |
| strategy: | |
| matrix: | |
| test-site: | |
| - https://www.saucedemo.com/ | |
| - https://demo.realworld.io/ | |
| - https://todomvc.com/examples/vanilla-es6/ | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Python ${{ env.PYTHON_VERSION }} | |
| uses: actions/setup-python@v4 | |
| with: | |
| python-version: ${{ env.PYTHON_VERSION }} | |
| - name: Install dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install -r requirements.txt | |
| playwright install chromium | |
| - name: Run tests against ${{ matrix.test-site }} | |
| env: | |
| GOOGLE_API_KEY: ${{ secrets.GOOGLE_API_KEY }} | |
| run: | | |
| mkdir -p results/${{ matrix.test-site }} | |
| python main.py --url ${{ matrix.test-site }} | |
| - name: Upload test results | |
| if: always() | |
| uses: actions/upload-artifact@v3 | |
| with: | |
| name: scheduled-test-results-${{ matrix.test-site }} | |
| path: results/ | |
| - name: Send Slack notification on failure | |
| if: failure() | |
| uses: 8398a7/action-slack@v3 | |
| with: | |
| status: failure | |
| channel: '#testing-alerts' | |
| text: 'Scheduled test failed for ${{ matrix.test-site }}' | |
| env: | |
| SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} | |
| performance-monitoring: | |
| runs-on: ubuntu-latest | |
| name: Performance Monitoring | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Python ${{ env.PYTHON_VERSION }} | |
| uses: actions/setup-python@v4 | |
| with: | |
| python-version: ${{ env.PYTHON_VERSION }} | |
| - name: Install dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install -r requirements.txt | |
| pip install memory-profiler psutil | |
| playwright install chromium | |
| - name: Run performance tests | |
| env: | |
| GOOGLE_API_KEY: ${{ secrets.GOOGLE_API_KEY }} | |
| run: | | |
| python -m memory_profiler main.py --url https://www.saucedemo.com/ | |
| - name: Generate performance report | |
| run: | | |
| echo "Performance monitoring completed" > performance-report.txt | |
| # Add performance metrics collection here | |
| - name: Upload performance results | |
| uses: actions/upload-artifact@v3 | |
| with: | |
| name: performance-results | |
| path: performance-report.txt |