From 5690c2ee529e37993bda03ba359d6f611c625a4c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jiri=20Dan=C4=9Bk?= Date: Thu, 26 Jun 2025 21:08:17 +0200 Subject: [PATCH] ci(ws): archive frontend cypress test results in github actions (#396) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Jiri Daněk --- .github/workflows/ws-frontend-test.yml | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/.github/workflows/ws-frontend-test.yml b/.github/workflows/ws-frontend-test.yml index 1f935d2b..5e3b5bec 100644 --- a/.github/workflows/ws-frontend-test.yml +++ b/.github/workflows/ws-frontend-test.yml @@ -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: |