Skip to content

Commit 5690c2e

Browse files
authored
ci(ws): archive frontend cypress test results in github actions (#396)
Signed-off-by: Jiri Daněk <[email protected]>
1 parent fcb5fc5 commit 5690c2e

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

.github/workflows/ws-frontend-test.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,34 @@ jobs:
4242

4343
- name: Run tests
4444
working-directory: workspaces/frontend
45+
# use id to skip archiving artifacts if running the tests was skipped, usually due to failure in steps above
46+
# https://docs.github.com/en/actions/writing-workflows/choosing-what-your-workflow-does/accessing-contextual-information-about-workflow-runs#steps-context
47+
id: run-tests
4548
run: npm run test
4649

50+
- name: Upload Cypress test report
51+
uses: actions/upload-artifact@v4
52+
if: "!cancelled() && steps.run-tests.outcome != 'skipped'"
53+
with:
54+
name: cypress-report
55+
path: |
56+
workspaces/frontend/src/__tests__/cypress/results/mocked/index.html
57+
workspaces/frontend/src/__tests__/cypress/results/mocked/junit-report.xml
58+
59+
- name: Upload Cypress screenshots (on failure)
60+
uses: actions/upload-artifact@v4
61+
if: "failure() && steps.run-tests.outcome == 'failure'"
62+
with:
63+
name: cypress-screenshots
64+
path: workspaces/frontend/src/__tests__/cypress/results/mocked/screenshots
65+
66+
- name: Upload Cypress video recordings (on failure)
67+
uses: actions/upload-artifact@v4
68+
if: "failure() && steps.run-tests.outcome == 'failure'"
69+
with:
70+
name: cypress-videos
71+
path: workspaces/frontend/src/__tests__/cypress/results/mocked/videos
72+
4773
- name: Check if there are uncommitted file changes
4874
working-directory: workspaces/frontend
4975
run: |

0 commit comments

Comments
 (0)