-
Notifications
You must be signed in to change notification settings - Fork 0
57 lines (56 loc) · 2.3 KB
/
regression-daily.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
name: Regression Daily
on:
schedule:
- cron: "0 0 * * *"
jobs:
all-tests:
runs-on: ubuntu-latest
strategy:
# when one test fails, DO NOT cancel the other
# containers, because this will kill Cypress processes
# leaving the Dashboard hanging ...
# https://github.com/cypress-io/github-action/issues/48
fail-fast: false
matrix:
# run 5 copies of the current job in parallel
containers: [1, 2, 3]
steps:
- name: Checkout Repository
uses: actions/checkout@v2
- name: Set the browser
env:
DEFAULT_BROWSER: chrome
DEFAULT_ENVIRONMENT: staging
run: |
echo "BROWSER=${{ github.event.inputs.browser || env.DEFAULT_BROWSER }}" >> $GITHUB_ENV
echo "ENVIRONMENT=${{ github.event.inputs.environment || env.DEFAULT_ENVIRONMENT }}" >> $GITHUB_ENV
- uses: cypress-io/github-action@v4
with:
# only record the results to dashboard.cypress.io if CYPRESS_RECORD_KEY is set
record: ${{ !!secrets.CYPRESS_RECORD_KEY }}
# only do parallel if we have a record key
parallel: ${{ !!secrets.CYPRESS_RECORD_KEY }}
browser: ${{ env.BROWSER }}
spec: cypress/e2e/**
env:
CYPRESS_password: ${{ secrets.STAGING_PASSWORD }}
CYPRESS_testEnv: ${{ env.ENVIRONMENT }}
# pass the Dashboard record key as an environment variable
CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }}
# pass GitHub token to allow accurately detecting a build vs a re-run build
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# turn on code coverage when running npm start
# so far we've been using a webpack coverage-istanbul-loader for this
# but there has been work on using the code coverage support in the browser directly,
# which should be much faster
CODE_COVERAGE: true
# Also turn on the code coverage tasks in cypress itself, these are disabled
# by default.
CYPRESS_coverage: true
# Increase memory allocation
NODE_OPTIONS: "--max_old_space_size=4096"
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v2
with:
flags: cypress
token: ${{ secrets.CODECOV_TOKEN }}