ci(ws): archive frontend cypress test results in github actions (#396)

Signed-off-by: Jiri Daněk <jdanek@redhat.com>
This commit is contained in:
Jiri Daněk 2025-06-26 21:08:17 +02:00 committed by GitHub
parent fcb5fc5272
commit 5690c2ee52
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 26 additions and 0 deletions

View File

@ -42,8 +42,34 @@ jobs:
- name: Run tests
working-directory: workspaces/frontend
# use id to skip archiving artifacts if running the tests was skipped, usually due to failure in steps above
# https://docs.github.com/en/actions/writing-workflows/choosing-what-your-workflow-does/accessing-contextual-information-about-workflow-runs#steps-context
id: run-tests
run: npm run test
- name: Upload Cypress test report
uses: actions/upload-artifact@v4
if: "!cancelled() && steps.run-tests.outcome != 'skipped'"
with:
name: cypress-report
path: |
workspaces/frontend/src/__tests__/cypress/results/mocked/index.html
workspaces/frontend/src/__tests__/cypress/results/mocked/junit-report.xml
- name: Upload Cypress screenshots (on failure)
uses: actions/upload-artifact@v4
if: "failure() && steps.run-tests.outcome == 'failure'"
with:
name: cypress-screenshots
path: workspaces/frontend/src/__tests__/cypress/results/mocked/screenshots
- name: Upload Cypress video recordings (on failure)
uses: actions/upload-artifact@v4
if: "failure() && steps.run-tests.outcome == 'failure'"
with:
name: cypress-videos
path: workspaces/frontend/src/__tests__/cypress/results/mocked/videos
- name: Check if there are uncommitted file changes
working-directory: workspaces/frontend
run: |