From ac0a820044a4185de8a1479d0cf023c5cd361077 Mon Sep 17 00:00:00 2001 From: Andrew Goldis Date: Thu, 16 Nov 2023 21:28:30 -0800 Subject: [PATCH] Update README --- .github/workflows/currents.yml | 15 +++++++-------- README.md | 26 +++++++++++++++++++++++++- 2 files changed, 32 insertions(+), 9 deletions(-) diff --git a/.github/workflows/currents.yml b/.github/workflows/currents.yml index 8981a79..28e6906 100644 --- a/.github/workflows/currents.yml +++ b/.github/workflows/currents.yml @@ -26,7 +26,7 @@ jobs: # Install Currents - name: Install dependencies run: | - yarn install --frozen-lockfile + npx ci - name: Unblock Cypress # working-directory: "services/rails" @@ -34,26 +34,25 @@ jobs: echo 🕊️ Download Free Cypress CYPRESS_DOWNLOAD_MIRROR=https://cy-cdn.currents.dev npx cypress install --force - echo 🕊️ Verify Cypress + echo ✅ Verify Cypress npx cypress verify echo 👀 Cypress Cache - yarn cypress cache list - yarn cypress cache path - - echo 👀 Cypress SHA - file `npx cypress cache path`/12.17.4/Cypress/Cypress + npx cypress cache list + npx cypress cache path - name: Run Cypress on Currents.dev env: + # enable verbose logging DEBUG: \@cypress/github-action uses: cypress-io/github-action@v6 continue-on-error: true with: + # 🔥 Set to false to prevent restoring cached blocking Cypress binary install: false command: | - yarn 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() }} diff --git a/README.md b/README.md index 4991127..ae1ac41 100644 --- a/README.md +++ b/README.md @@ -6,6 +6,8 @@ The example [workflow config file](https://github.com/currents-dev/gh-actions-ex - runs 3 containers with cypress tests in parallel +- install block-free Cypress binaries + - uses [Custom Test Command](https://github.com/cypress-io/github-action#custom-test-command) to run `cypress-cloud` for recording test results and parallelization with [Currents.dev](https://currents.dev) - Note: get your record key from [Currents.dev](https://app.currents.dev) and set [GH secret](https://docs.github.com/en/actions/reference/encrypted-secrets) variable `CURRENTS_RECORD_KEY` @@ -16,5 +18,27 @@ The example [workflow config file](https://github.com/currents-dev/gh-actions-ex Here's an example of how the demo workflow appears in Currents dashboard: - https://user-images.githubusercontent.com/1637928/227701237-db4d7a7f-b26b-46ac-ba6a-3806ede37671.mp4 + +## Using Alternative Cypress Binaries + +Following [aggressive blocking](https://github.com/cypress-io/cypress/issues/28269) by Cypress.io team we released alternative, block-free Cypress binaries that were compiled from the MIT-licensed Cypress source code. + +The documentation is available at: https://currents.dev/readme/integration-with-cypress/alternative-cypress-binaries. + +The example in this repository uses [cypress-io/github-action@v6](https://github.com/cypress-io/github-action). `cypress-io/github-action` **caches and restores cypress binaries before running the tests** - you need to disable this behaviour to use the freshly installed non-blocking binaries: + +```yml +- name: Run Cypress on Currents.dev + env: + # enable verbose logging + DEBUG: \@cypress/github-action + 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}}" +```