From 2821c440f733b07b2376760b4f2c40d7e8809967 Mon Sep 17 00:00:00 2001 From: Andrew Goldis Date: Tue, 28 Nov 2023 13:29:17 -0800 Subject: [PATCH 01/10] print env vars --- .github/workflows/currents.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/currents.yml b/.github/workflows/currents.yml index 28e6906..8372e64 100644 --- a/.github/workflows/currents.yml +++ b/.github/workflows/currents.yml @@ -23,6 +23,10 @@ jobs: with: node-version: 16 + - name: Print Env variables + run: | + printenv + # Install Currents - name: Install dependencies run: | From 93d5860ee4e902de878ca812acfe70d4ecfa5070 Mon Sep 17 00:00:00 2001 From: Andrew Goldis Date: Tue, 28 Nov 2023 13:31:57 -0800 Subject: [PATCH 02/10] .. --- .github/workflows/currents.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/currents.yml b/.github/workflows/currents.yml index 8372e64..0b91177 100644 --- a/.github/workflows/currents.yml +++ b/.github/workflows/currents.yml @@ -33,7 +33,6 @@ jobs: npx ci - name: Unblock Cypress - # working-directory: "services/rails" run: | echo 🕊️ Download Free Cypress CYPRESS_DOWNLOAD_MIRROR=https://cy-cdn.currents.dev npx cypress install --force @@ -56,7 +55,7 @@ jobs: # 🔥 Set to false to prevent restoring cached blocking Cypress binary install: false command: | - npx cypress-cloud --record --parallel --browser chrome --key ${{ secrets.CURRENTS_RECORD_KEY }} --ci-build-id "${{ github.repository }}-${{ github.run_id }}-${{ github.run_attempt}}" + npx cypress-cloud --record --parallel --browser chrome --key ${{ secrets.CURRENTS_RECORD_KEY }} --ci-build-id ${{ github.repository }}-${{ github.run_id }}-${{ github.run_attempt}} - name: Cancel the run if workflow is cancelled if: ${{ cancelled() }} From ffa37d5df8e455eee69e96a700991f5d7bdf44d7 Mon Sep 17 00:00:00 2001 From: Andrew Goldis Date: Tue, 28 Nov 2023 13:32:33 -0800 Subject: [PATCH 03/10] run GHA on PR --- .github/workflows/currents.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/currents.yml b/.github/workflows/currents.yml index 0b91177..938938f 100644 --- a/.github/workflows/currents.yml +++ b/.github/workflows/currents.yml @@ -1,7 +1,7 @@ name: Cypress Tests on: - push: + pull_request: jobs: cypress-tests: From 22233e706416febd4aef64c8b16ce3f041eb6965 Mon Sep 17 00:00:00 2001 From: Andrew Goldis Date: Tue, 28 Nov 2023 13:47:27 -0800 Subject: [PATCH 04/10] print event payload --- .github/workflows/currents.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/currents.yml b/.github/workflows/currents.yml index 938938f..fb6b2be 100644 --- a/.github/workflows/currents.yml +++ b/.github/workflows/currents.yml @@ -23,6 +23,10 @@ jobs: with: node-version: 16 + - name: Print Event Payload + run: | + cat $GITHUB_EVENT_PATH + - name: Print Env variables run: | printenv From ce46f7ee1d829aaae1e0c703ab5ed25aa1705807 Mon Sep 17 00:00:00 2001 From: Andrew Goldis Date: Thu, 25 Jan 2024 10:19:02 -0800 Subject: [PATCH 05/10] use "cypress-cloud": "1.10.0-alpha.0", --- .gitignore | 1 + package.json | 2 +- yarn.lock | 37 +++++++++++++++---------------------- 3 files changed, 17 insertions(+), 23 deletions(-) diff --git a/.gitignore b/.gitignore index ced1514..916576b 100644 --- a/.gitignore +++ b/.gitignore @@ -8,6 +8,7 @@ yarn-debug.log* yarn-error.log* lerna-debug.log* +cypress-traces # Diagnostic reports (https://nodejs.org/api/report.html) report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json diff --git a/package.json b/package.json index 955118b..f81cf95 100644 --- a/package.json +++ b/package.json @@ -12,7 +12,7 @@ "license": "ISC", "dependencies": { "cypress": "12.17.4", - "cypress-cloud": "^1.9.6", + "cypress-cloud": "1.10.0-alpha.0", "typescript": "^5.0.2" } } diff --git a/yarn.lock b/yarn.lock index 4fc3989..513b741 100644 --- a/yarn.lock +++ b/yarn.lock @@ -14,14 +14,14 @@ resolved "https://registry.yarnpkg.com/@colors/colors/-/colors-1.5.0.tgz#bb504579c1cae923e6576a4f5da43d25f97bdbd9" integrity sha512-ooWCrlZP11i8GImSjTHYHLkvFDP48nS4+204nGb1RiX/WXYHmJA2III9/e2DWVabCESdW7hBAEzHRqUn9OUVvQ== -"@cypress/commit-info@^2.2.0": - version "2.2.0" - resolved "https://registry.yarnpkg.com/@cypress/commit-info/-/commit-info-2.2.0.tgz#6086d478975edb7ac7c9ffdd5cfd5be2b9fe44f2" - integrity sha512-A7CYS0Iqp/u52JTnSWlDFjWMKx7rIfd+mk0Fdksrcs4Wdf5HXPsoZO475VJ+xL7LPhJrjKhgyl/TPKO3worZyQ== +"@currents/commit-info@1.0.1-beta.0": + version "1.0.1-beta.0" + resolved "https://registry.yarnpkg.com/@currents/commit-info/-/commit-info-1.0.1-beta.0.tgz#c33112685c27896bba29064234fd2341ec9134e6" + integrity sha512-gkn8E3UC+F4/fCla7QAGMGgGPzxZUL9bU9+4I+KZf9PtCU3DdQCdy7a+er2eg4ewfUzZ2Ic1HcfnHuPkuLPKIw== dependencies: bluebird "3.5.5" check-more-types "2.24.0" - debug "4.1.1" + debug "4.3.4" execa "1.0.0" lazy-ass "1.6.0" ramda "0.26.1" @@ -452,12 +452,12 @@ cy2@^3.4.2: npm-which "^3.0.1" slash "3.0.0" -cypress-cloud@^1.9.6: - version "1.9.6" - resolved "https://registry.yarnpkg.com/cypress-cloud/-/cypress-cloud-1.9.6.tgz#a2a8335621bce30a575e2f293a7e63193bda6b17" - integrity sha512-cF1+Eqpscm9H0CkHdRxgleW+sSBCL3e614KeEKaghROLYrTTvep8vSouSBqWAsJ6tzaNJK4ybVIfDFswNP1bHQ== +cypress-cloud@1.10.0-alpha.0: + version "1.10.0-alpha.0" + resolved "https://registry.yarnpkg.com/cypress-cloud/-/cypress-cloud-1.10.0-alpha.0.tgz#a59e3cd0fa9dbf71625a22a63190d6f1986c2b0e" + integrity sha512-cAgD9j2SEfFf39klGGPwtE+CmFxlNLMfmn+nRPtkEoBMtLxVrL6eD8cQyzp8Kkv3Skl1i1JRmmN1ISJHdniE1g== dependencies: - "@cypress/commit-info" "^2.2.0" + "@currents/commit-info" "1.0.1-beta.0" axios "^1.2.0" axios-retry "^3.4.0" bluebird "^3.7.2" @@ -542,12 +542,12 @@ dayjs@^1.10.4: resolved "https://registry.yarnpkg.com/dayjs/-/dayjs-1.11.10.tgz#68acea85317a6e164457d6d6947564029a6a16a0" integrity sha512-vjAczensTgRcqDERK0SR2XMwsF/tSvnvlv6VcF2GIhg6Sx4yOIt/irsr1RDJsKiIyBzJDpCoXiWWq28MqH2cnQ== -debug@4.1.1: - version "4.1.1" - resolved "https://registry.yarnpkg.com/debug/-/debug-4.1.1.tgz#3b72260255109c6b589cee050f1d516139664791" - integrity sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw== +debug@4.3.4, debug@^4.1.1, debug@^4.3.2, debug@^4.3.4: + version "4.3.4" + resolved "https://registry.yarnpkg.com/debug/-/debug-4.3.4.tgz#1319f6579357f2338d3337d2cdd4914bb5dcc865" + integrity sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ== dependencies: - ms "^2.1.1" + ms "2.1.2" debug@^3.1.0: version "3.2.7" @@ -556,13 +556,6 @@ debug@^3.1.0: dependencies: ms "^2.1.1" -debug@^4.1.1, debug@^4.3.2, debug@^4.3.4: - version "4.3.4" - resolved "https://registry.yarnpkg.com/debug/-/debug-4.3.4.tgz#1319f6579357f2338d3337d2cdd4914bb5dcc865" - integrity sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ== - dependencies: - ms "2.1.2" - define-data-property@^1.1.1: version "1.1.1" resolved "https://registry.yarnpkg.com/define-data-property/-/define-data-property-1.1.1.tgz#c35f7cd0ab09883480d12ac5cb213715587800b3" From a96af4a97787baa59e482964078a03fb86c32b1a Mon Sep 17 00:00:00 2001 From: Andrew Goldis Date: Thu, 25 Jan 2024 10:21:35 -0800 Subject: [PATCH 06/10] chore: add staging GHA flow --- .github/workflows/currents-staging.yml | 73 ++++++++++++++++++++++++++ 1 file changed, 73 insertions(+) create mode 100644 .github/workflows/currents-staging.yml diff --git a/.github/workflows/currents-staging.yml b/.github/workflows/currents-staging.yml new file mode 100644 index 0000000..70ea36e --- /dev/null +++ b/.github/workflows/currents-staging.yml @@ -0,0 +1,73 @@ +name: Cypress Tests + +on: + pull_request: + +jobs: + cypress-tests: + runs-on: ubuntu-20.04 + strategy: + fail-fast: false + matrix: + # run 3 copies of the current job in parallel + containers: [1, 2, 3] + steps: + - name: Checkout + uses: actions/checkout@v3 + # populate commit message for merge commits + # see https://currents.dev/readme/ci-setup/github-actions + # with: + # ref: ${{ github.event.pull_request.head.sha }} + + - uses: actions/setup-node@v3 + with: + node-version: 16 + + - name: Print Event Payload + run: | + cat $GITHUB_EVENT_PATH + + - name: Print Env variables + run: | + printenv + + # Install Currents + - name: Install dependencies + run: | + npx ci + + - name: Unblock Cypress + run: | + echo 🕊️ Download Free Cypress + CYPRESS_DOWNLOAD_MIRROR=https://cy-cdn.currents.dev npx cypress install --force + + echo ✅ Verify Cypress + npx cypress verify + + echo 👀 Cypress Cache + npx cypress cache list + npx cypress cache path + + - name: Run Cypress on Currents.dev + env: + # enable verbose logging + DEBUG: \@cypress/github-action + CURRENTS_ENFORCE_IS_CURRENTS: 1 + CURRENTS_PROJECT_ID: 9aOuF6 + CURRENTS_API_URL: https://cy-staging.currents.dev + uses: cypress-io/github-action@v6 + continue-on-error: true + + with: + # 🔥 Set to false to prevent restoring cached blocking Cypress binary + install: false + command: | + npx cypress-cloud --record --parallel --browser chrome --key ${{ secrets.CURRENTS_RECORD_KEY }} --ci-build-id ${{ github.repository }}-${{ github.run_id }}-${{ github.run_attempt}} + + - name: Cancel the run if workflow is cancelled + if: ${{ cancelled() }} + uses: currents-dev/cancel-run-gh-action@v1 + with: + api-token: ${{ secrets.CURRENTS_API_KEY_STAGING }} + github-run-id: ${{ github.run_id }} + github-run-attempt: ${{ github.run_attempt }} From 4e40d2d84fef09a5f099e126fd7b4d8fcc70c2bf Mon Sep 17 00:00:00 2001 From: Andrew Goldis Date: Thu, 25 Jan 2024 10:22:11 -0800 Subject: [PATCH 07/10] chore: change GHA flow name --- .github/workflows/currents-staging.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/currents-staging.yml b/.github/workflows/currents-staging.yml index 70ea36e..8acbf2c 100644 --- a/.github/workflows/currents-staging.yml +++ b/.github/workflows/currents-staging.yml @@ -1,4 +1,4 @@ -name: Cypress Tests +name: Cypress Tests Staging on: pull_request: From f7ebb750b7b3f0fdeea3f66606007cc7ab877fae Mon Sep 17 00:00:00 2001 From: Andrew Goldis Date: Thu, 25 Jan 2024 10:24:19 -0800 Subject: [PATCH 08/10] .. --- .github/{workflows => }/currents.yml | 0 .github/workflows/currents-staging.yml | 4 ++-- 2 files changed, 2 insertions(+), 2 deletions(-) rename .github/{workflows => }/currents.yml (100%) diff --git a/.github/workflows/currents.yml b/.github/currents.yml similarity index 100% rename from .github/workflows/currents.yml rename to .github/currents.yml diff --git a/.github/workflows/currents-staging.yml b/.github/workflows/currents-staging.yml index 8acbf2c..a658fdb 100644 --- a/.github/workflows/currents-staging.yml +++ b/.github/workflows/currents-staging.yml @@ -21,7 +21,7 @@ jobs: - uses: actions/setup-node@v3 with: - node-version: 16 + node-version: 18 - name: Print Event Payload run: | @@ -62,7 +62,7 @@ jobs: # 🔥 Set to false to prevent restoring cached blocking Cypress binary install: false command: | - npx cypress-cloud --record --parallel --browser chrome --key ${{ secrets.CURRENTS_RECORD_KEY }} --ci-build-id ${{ github.repository }}-${{ github.run_id }}-${{ github.run_attempt}} + CURRENTS_API_URL=https://cy-staging.currents.dev CURRENTS_PROJECT_ID=9aOuF6 CURRENTS_ENFORCE_IS_CURRENTS=1 npx cypress-cloud --record --parallel --browser chrome --key ${{ secrets.CURRENTS_RECORD_KEY }} --ci-build-id ${{ github.repository }}-${{ github.run_id }}-${{ github.run_attempt}} - name: Cancel the run if workflow is cancelled if: ${{ cancelled() }} From a4caead3c7799bb82964c2207df018ea3ed61fcd Mon Sep 17 00:00:00 2001 From: Andrew Goldis Date: Thu, 25 Jan 2024 10:24:49 -0800 Subject: [PATCH 09/10] .. --- .github/workflows/currents-staging.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/currents-staging.yml b/.github/workflows/currents-staging.yml index a658fdb..26c2811 100644 --- a/.github/workflows/currents-staging.yml +++ b/.github/workflows/currents-staging.yml @@ -62,7 +62,7 @@ jobs: # 🔥 Set to false to prevent restoring cached blocking Cypress binary install: false command: | - CURRENTS_API_URL=https://cy-staging.currents.dev CURRENTS_PROJECT_ID=9aOuF6 CURRENTS_ENFORCE_IS_CURRENTS=1 npx cypress-cloud --record --parallel --browser chrome --key ${{ secrets.CURRENTS_RECORD_KEY }} --ci-build-id ${{ github.repository }}-${{ github.run_id }}-${{ github.run_attempt}} + CURRENTS_API_URL=https://cy-staging.currents.dev CURRENTS_PROJECT_ID=9aOuF6 CURRENTS_ENFORCE_IS_CURRENTS=1 npx cypress-cloud --record --parallel --browser chrome --key ${{ secrets.CURRENTS_RECORD_KEY }} --ci-build-id ${{ github.repository }}-${{ github.run_id }}-${{ github.run_attempt}} - name: Cancel the run if workflow is cancelled if: ${{ cancelled() }} From 7422e2fe9dbc424a0863b9ab10a23a34beb0ed75 Mon Sep 17 00:00:00 2001 From: Andrew Goldis Date: Thu, 25 Jan 2024 10:27:47 -0800 Subject: [PATCH 10/10] .. --- .github/workflows/currents-staging.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/currents-staging.yml b/.github/workflows/currents-staging.yml index 26c2811..1b87292 100644 --- a/.github/workflows/currents-staging.yml +++ b/.github/workflows/currents-staging.yml @@ -62,7 +62,7 @@ jobs: # 🔥 Set to false to prevent restoring cached blocking Cypress binary install: false command: | - CURRENTS_API_URL=https://cy-staging.currents.dev CURRENTS_PROJECT_ID=9aOuF6 CURRENTS_ENFORCE_IS_CURRENTS=1 npx cypress-cloud --record --parallel --browser chrome --key ${{ secrets.CURRENTS_RECORD_KEY }} --ci-build-id ${{ github.repository }}-${{ github.run_id }}-${{ github.run_attempt}} + npx cypress-cloud --record --parallel --browser chrome --key ${{ secrets.CURRENTS_RECORD_KEY_STAGING }} --ci-build-id ${{ github.repository }}-${{ github.run_id }}-${{ github.run_attempt}} - name: Cancel the run if workflow is cancelled if: ${{ cancelled() }}