Local Prod E2E Tests #263
This file contains 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: Local Prod E2E Tests | |
on: | |
schedule: | |
- cron: '0 9,13,15,21 * * 1-5' # Runs at 6:00, 12:00, and 18:00 in UTC-3 | |
workflow_dispatch: | |
jobs: | |
run-local-prod-e2e-tests: | |
name: Run Local Prod E2E Tests | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
actions: read | |
env: | |
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Setup Node.js Environment | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 18 | |
- name: Run Cypress E2E Tests | |
uses: cypress-io/github-action@v6 | |
env: | |
PROD_CYPRESS_EMAIL: ${{ secrets.PROD_CYPRESS_EMAIL }} | |
PROD_CYPRESS_PASSWORD: ${{ secrets.PROD_CYPRESS_PASSWORD }} | |
VITE_ENVIRONMENT: "production" | |
with: | |
build: yarn build | |
start: yarn dev --logLevel=warn | |
browser: chrome | |
wait-on: 'http://localhost:5173/' | |
wait-on-timeout: 120 | |
config-file: cypress.config.prod.js | |
env: environment=prod,grepTags=-@xfail+-@dont_run_prod | |
- name: Check E2E Test Coverage | |
if: ${{ always() }} | |
run: node ./scripts/check_coverage.js ./coverage/e2e/lcov.info 20 | |
- name: Compress E2E Coverage Reports | |
if: ${{ always() }} | |
run: | | |
rm -rf coverage/e2e/lcov-report | |
zip -r coverage.zip coverage | |
- name: Upload E2E Coverage Report Artifact | |
if: ${{ always() }} | |
uses: actions/upload-artifact@v4 | |
with: | |
name: coverage_e2e_report | |
path: coverage.zip | |
retention-days: 7 | |
- name: Upload Cypress Screenshots Artifact | |
if: ${{ failure() }} | |
uses: actions/upload-artifact@v4 | |
with: | |
name: cypress_screenshots | |
path: cypress/screenshots | |
retention-days: 4 | |
- name: Upload Cypress Videos Artifact | |
if: ${{ failure() }} | |
uses: actions/upload-artifact@v4 | |
with: | |
name: cypress_videos | |
path: cypress/videos | |
retention-days: 1 | |
- name: Notify test completion in Slack | |
if: ${{ always() && github.event_name == 'schedule' && env.SLACK_WEBHOOK_URL != ''}} | |
uses: 8398a7/action-slack@v3 | |
with: | |
status: ${{ job.status }} | |
job_name: Run Local Prod E2E Tests | |
fields: job,took,workflow | |
env: | |
SLACK_WEBHOOK_URL: ${{ env.SLACK_WEBHOOK_URL }} |