-
Notifications
You must be signed in to change notification settings - Fork 369
62 lines (52 loc) · 1.73 KB
/
cypress-test.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
name: Cypress Test
# Controls when the action will run.
on:
# Triggers unit test on push events for the main branch to collect unit test coverage
push:
branches: [main]
workflow_dispatch:
jobs:
e2e-test:
runs-on: ubuntu-20.04
strategy:
matrix:
node-version: [16.x]
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node-version }}
- name: Install Pnpm
run: corepack enable
- name: Turbo Cache
id: turbo-cache
uses: actions/cache@v3
with:
path: .turbo
key: turbo-${{ github.ref_name }}-${{ github.sha }}
restore-keys: |
turbo-${{ github.ref_name }}-
turbo-
- name: Install Dependencies
run: pnpm install --ignore-scripts --frozen-lockfile
- name: Install cypress
run: npx cypress install
- name: Prepare
if: ${{steps.docs-change.outputs.DOCS_CHANGE != 'docs only change'}}
run: pnpm run prepare
- name: Run cypress test
uses: cypress-io/github-action@v4
with:
install: false
start: sh scripts/dev-project.sh
wait-on: 'http://localhost:3001,http://localhost:3002,http://localhost:3003/index.js'
wait-on-timeout: 600
working-directory: tests
spec: cypress/e2e/**/*.cy.js
env:
CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }}
# Recommended: pass the GitHub token lets this action correctly
# determine the unique run id necessary to re-run the checks
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}