Skip to content

Staging Health Check #2208

Staging Health Check

Staging Health Check #2208

name: Staging Health Check
on:
workflow_dispatch: {}
schedule:
- cron: "0 0/12 * * *"
permissions:
contents: read
jobs:
staging-health-check:
name: Run Staging 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://staging.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