-
Notifications
You must be signed in to change notification settings - Fork 0
82 lines (72 loc) · 2.6 KB
/
staging-health-check.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
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