Production Health Check #12924
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: Production Health Check | |
on: | |
workflow_dispatch: {} | |
schedule: | |
- cron: "0 0/2 * * *" | |
permissions: | |
contents: read | |
jobs: | |
production-health-check: | |
name: Run Production Health Check | |
runs-on: ubuntu-20.04 | |
container: | |
image: sctrainer/main:ci-chrome-v4 | |
# This is needed for Firefox running as described here | |
# https://github.com/cypress-io/github-action/issues/104 | |
options: --user 1001 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Handle Yarn caching | |
uses: actions/cache@v4 | |
env: | |
cache-name: yarn-cache-v2 | |
with: | |
path: | | |
~/.cache/yarn | |
key: ${{ job.container.image }}-${{ env.cache-name }}-${{ hashFiles('end-to-end-tests/**/yarn.lock')}} | |
# Note we purposefully don't specify fallback restore keys. | |
# Explanation: https://glebbahmutov.com/blog/do-not-let-cypress-cache-snowball/ | |
- name: Handle Cypress caching | |
uses: actions/cache@v4 | |
env: | |
cache-name: cypress-cache-v2 | |
with: | |
path: | | |
~/.cache/Cypress | |
key: ${{ job.container.image }}-${{ env.cache-name }}-${{ hashFiles('end-to-end-tests/**/yarn.lock')}} | |
# Note we purposefully don't specify fallback restore keys. | |
# Explanation: https://glebbahmutov.com/blog/do-not-let-cypress-cache-snowball/ | |
- name: Install Dependencies | |
run: yarn --frozen-lockfile | |
working-directory: end-to-end-tests | |
- name: Log Cypress Info | |
run: npx cypress info | |
working-directory: end-to-end-tests | |
- name: Run Cypress Tests | |
working-directory: end-to-end-tests | |
run: > | |
./node_modules/.bin/cypress run | |
--browser chrome | |
--config '{"baseUrl": "https://www.sc-trainer.com", "e2e": {"specPattern": "cypress/smoke-tests"}}' | |
- name: Upload recorded videos | |
uses: actions/upload-artifact@v4 | |
if: failure() | |
continue-on-error: true | |
with: | |
name: VIDEOS-cypress-${{ matrix.platform.browser }}-${{ matrix.sizeRelevant.deviceName }}-${{ github.sha }} | |
path: end-to-end-tests/cypress/videos | |
- name: Upload recorded Screenshots | |
uses: actions/upload-artifact@v4 | |
if: failure() | |
continue-on-error: true | |
with: | |
name: SCREENSHOTS-cypress-${{ matrix.platform.browser }}-${{ matrix.sizeRelevant.deviceName }}-${{ github.sha }} | |
path: end-to-end-tests/cypress/screenshots | |
# | |
# | |
# Useful for debugging: | |
# - uses: mxschmitt/action-tmate@v3 | |
# with: | |
# limit-access-to-actor: true | |
# sudo: false |