From 24d5bb82c05847c6e78b3f1d855c1114a184ace7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kasper=20Garn=C3=A6s?= Date: Mon, 23 Oct 2023 11:08:00 +0200 Subject: [PATCH] Initial support for Cypress Cloud This should allow running tests in parallel to provide a faster testing process. Also it may provide a better test debugging experience. All setup is based on the example from the documentation: https://github.com/cypress-io/github-action#split-install-and-tests --- .github/workflows/tests.yml | 15 +++++++++++++++ cypress.json | 3 ++- 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index f6df7c7d8a..0d01c41006 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -12,6 +12,14 @@ jobs: options: --user 1001 env: TZ: Europe/Copenhagen + strategy: + # When one test fails, DO NOT cancel the other containers, because this + # will kill Cypress processes leaving Cypress Cloud hanging. + # https://github.com/cypress-io/github-action/issues/48 + fail-fast: false + matrix: + # Run 3 copies of the current job in parallel + containers: [1, 2, 3] steps: - uses: actions/checkout@master - name: Setup Node @@ -28,9 +36,16 @@ jobs: - name: Cypress run uses: cypress-io/github-action@v6 with: + install: false start: yarn start:storybook:test wait-on: "http://localhost:57021" browser: chrome + group: "Integration tests" + parallel: true + record: true + env: + CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }} + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - name: Upload screenshots uses: actions/upload-artifact@v3 if: failure() diff --git a/cypress.json b/cypress.json index 6f523ce288..54d232b3d0 100644 --- a/cypress.json +++ b/cypress.json @@ -6,5 +6,6 @@ "retries": { "runMode": 3, "openMode": 0 - } + }, + "projectId": "4trcdv" }