Skip to content

Commit 5b3bfca

Browse files
committed
Refactor cypress test slightly
1 parent a2fc1e1 commit 5b3bfca

1 file changed

Lines changed: 20 additions & 7 deletions

File tree

.github/workflows/main.yml

Lines changed: 20 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,14 @@ jobs:
6666
node-version: 16
6767
cache: 'yarn'
6868

69+
- name: Cache Cypress binary
70+
uses: actions/cache@v1
71+
with:
72+
path: ~/.cache/Cypress
73+
key: cypress-${{ runner.os }}-cypress-${{ hashFiles('yarn.lock') }}
74+
restore-keys: |
75+
cypress-${{ runner.os }}-cypress-
76+
6977
- name: Install code
7078
run: yarn install --frozen-lock-file
7179

@@ -80,14 +88,19 @@ jobs:
8088
env:
8189
PUBLIC_URL: 'http://localhost:3000'
8290

83-
- name: Archive cypress artifacts
84-
uses: actions/upload-artifact@v3
85-
if: failure()
91+
- uses: actions/upload-artifact@v3
92+
with:
93+
name: cypress-screenshots
94+
path: cypress/screenshots
95+
# there might be no screenshots created when:
96+
# - there are no test failures
97+
# so only upload screenshots if previous step has failed
98+
if: failure()
99+
100+
- uses: actions/upload-artifact@v3
86101
with:
87-
name: cypress-artifacts
88-
path: |
89-
cypress/screenshots
90-
cypress/videos
102+
name: cypress-videos
103+
path: cypress/videos
91104

92105

93106
build-and-deploy-tag:

0 commit comments

Comments
 (0)