-
Notifications
You must be signed in to change notification settings - Fork 2
50 lines (49 loc) · 1.5 KB
/
tests.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
name: Cypress tests
on: pull_request
jobs:
cypress-run:
runs-on: ubuntu-latest
container:
image: cypress/browsers:latest
steps:
- name: Checkout
uses: actions/checkout@v4
- uses: actions/cache@v3
id: yarn-build-cache
with:
path: |
**/node_modules
~/.cache/Cypress
**/build
key: ${{ runner.os }}-node_modules-files-build-${{ hashFiles('./yarn.lock') }}
restore-keys: |
${{ runner.os }}-node_modules-build-
- name: Install dependencies
run: yarn install --immutable
- name: Build plugin
working-directory: packages/plugin
run: yarn build
# Install NPM dependencies, cache them correctly
# and run all Cypress tests
- name: Cypress run
uses: cypress-io/github-action@v6
with:
working-directory: packages/example
start: yarn start
wait-on: 'http://localhost:3333'
# custom test command to run
command: yarn test:ci
# store the screenshots if the tests fail
- name: Store screenshots
uses: actions/upload-artifact@v1
if: failure()
with:
name: cypress-screenshots
path: packages/example/cypress/screenshots
# store the videos if the tests fail
- name: Store videos
uses: actions/upload-artifact@v1
if: failure()
with:
name: cypress-videos
path: packages/example/cypress/videos