From ca975072110f8e3a7a18d96df9d35fcbaa5e7ef7 Mon Sep 17 00:00:00 2001 From: Dmitry Kruchinin <33020454+dvkruchinin@users.noreply.github.com> Date: Wed, 10 Mar 2021 22:48:52 +0300 Subject: [PATCH] Upload cypress screenshots folder as an artifact if the tests failed with an error. (#2934) * added upload cypress screenshots if a tests failed. * Replace command to run cypress tests in publish_docker_images.yml --- .github/workflows/main.yml | 6 ++++++ .github/workflows/publish_docker_images.yml | 9 ++++++++- .github/workflows/schedule.yml | 6 ++++++ 3 files changed, 20 insertions(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index d136f0cc..5d36ed29 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -38,6 +38,12 @@ jobs: cd ./tests npm ci npx cypress run --headless --browser chrome + - name: Uploading cypress screenshots as an artifact + if: failure() + uses: actions/upload-artifact@v2 + with: + name: cypress_screenshots + path: ${{ github.workspace }}/tests/cypress/screenshots - name: Collect coverage data env: HOST_COVERAGE_DATA_DIR: ${{ github.workspace }} diff --git a/.github/workflows/publish_docker_images.yml b/.github/workflows/publish_docker_images.yml index 44aad7e9..4c7353ee 100644 --- a/.github/workflows/publish_docker_images.yml +++ b/.github/workflows/publish_docker_images.yml @@ -33,7 +33,14 @@ jobs: run: | cd ./tests npm ci - npx cypress run --headless --browser chrome + npm run cypress:run:chrome + - name: Uploading cypress screenshots as an artifact + if: failure() + uses: actions/upload-artifact@v2 + with: + name: cypress_screenshots + path: ${{ github.workspace }}/tests/cypress/screenshots + - name: Login to Docker Hub uses: docker/login-action@v1 with: diff --git a/.github/workflows/schedule.yml b/.github/workflows/schedule.yml index ecce8547..90f53049 100644 --- a/.github/workflows/schedule.yml +++ b/.github/workflows/schedule.yml @@ -26,3 +26,9 @@ jobs: cd ./tests npm ci npm run cypress:run:firefox + - name: Uploading cypress screenshots as an artifact + if: failure() + uses: actions/upload-artifact@v2 + with: + name: cypress_screenshots + path: ${{ github.workspace }}/tests/cypress/screenshots