From 3d75022a6c15fade99006a56c4cdec997a728fc7 Mon Sep 17 00:00:00 2001 From: Felipe Knorr Kuhn <100320+knorrium@users.noreply.github.com> Date: Thu, 21 Jul 2022 23:02:26 -0700 Subject: [PATCH 1/3] Simplify Cypress GHA --- .github/workflows/cypress.yml | 86 +++++++++++------------------------ 1 file changed, 27 insertions(+), 59 deletions(-) diff --git a/.github/workflows/cypress.yml b/.github/workflows/cypress.yml index b057e6141..be7b224d4 100644 --- a/.github/workflows/cypress.yml +++ b/.github/workflows/cypress.yml @@ -10,82 +10,50 @@ jobs: strategy: fail-fast: false matrix: - containers: [1, 2, 3, 4, 5] - os: ["ubuntu-latest"] - browser: [chrome] - name: E2E tests on ${{ matrix.browser }} - ${{ matrix.os }} + module: ["mempool", "liquid", "bisq"] + include: + - module: "mempool" + spec: | + cypress/e2e/mainnet/*.spec.ts + cypress/e2e/signet/*.spec.ts + cypress/e2e/testnet/*.spec.ts + - module: "liquid" + spec: | + cypress/e2e/liquid/liquid.spec.ts + cypress/e2e/liquidtestnet/liquidtestnet.spec.ts + - module: "bisq" + spec: | + cypress/e2e/bisq/bisq.spec.ts + + name: E2E tests for ${{ matrix.module }} steps: - name: Checkout uses: actions/checkout@v2 + with: + path: ${{ matrix.module }} + - name: Setup node uses: actions/setup-node@v2 with: node-version: 16.15.0 cache: 'npm' - cache-dependency-path: frontend/package-lock.json - - name: ${{ matrix.browser }} browser tests (Mempool) - uses: cypress-io/github-action@v4 - with: - tag: ${{ github.event_name }} - working-directory: frontend - build: npm run config:defaults:mempool - start: npm run start:local-staging - wait-on: 'http://localhost:4200' - wait-on-timeout: 120 - record: true - parallel: true - spec: | - cypress/e2e/mainnet/*.spec.ts - cypress/e2e/signet/*.spec.ts - cypress/e2e/testnet/*.spec.ts - group: Tests on ${{ matrix.browser }} (Mempool) - browser: ${{ matrix.browser }} - ci-build-id: '${{ github.sha }}-${{ github.workflow }}-${{ github.event_name }}' - env: - COMMIT_INFO_MESSAGE: ${{ github.event.pull_request.title }} - CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }} - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - CYPRESS_PROJECT_ID: ${{ secrets.CYPRESS_PROJECT_ID }} + cache-dependency-path: ${{ matrix.module }}/frontend/package-lock.json + path: ${{ matrix.module }} - - name: ${{ matrix.browser }} browser tests (Liquid) + - name: Chrome browser tests (${{ matrix.module }}) uses: cypress-io/github-action@v4 - if: always() with: tag: ${{ github.event_name }} - working-directory: frontend - build: npm run config:defaults:liquid + working-directory: ${{ matrix.module }}/frontend + build: npm run config:defaults:${{ matrix.module }} start: npm run start:local-staging wait-on: 'http://localhost:4200' wait-on-timeout: 120 record: true parallel: true - spec: | - cypress/e2e/liquid/liquid.spec.ts - cypress/e2e/liquidtestnet/liquidtestnet.spec.ts - group: Tests on ${{ matrix.browser }} (Liquid) - browser: ${{ matrix.browser }} - ci-build-id: '${{ github.sha }}-${{ github.workflow }}-${{ github.event_name }}' - env: - COMMIT_INFO_MESSAGE: ${{ github.event.pull_request.title }} - CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }} - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - CYPRESS_PROJECT_ID: ${{ secrets.CYPRESS_PROJECT_ID }} - - - name: ${{ matrix.browser }} browser tests (Bisq) - uses: cypress-io/github-action@v4 - if: always() - with: - tag: ${{ github.event_name }} - working-directory: frontend - build: npm run config:defaults:bisq - start: npm run start:local-staging - wait-on: 'http://localhost:4200' - wait-on-timeout: 120 - record: true - parallel: true - spec: cypress/e2e/bisq/bisq.spec.ts - group: Tests on ${{ matrix.browser }} (Bisq) - browser: ${{ matrix.browser }} + spec: ${{ matrix.spec }} + group: Tests on Chrome (${{ matrix.module }}) + browser: "chrome" ci-build-id: '${{ github.sha }}-${{ github.workflow }}-${{ github.event_name }}' env: COMMIT_INFO_MESSAGE: ${{ github.event.pull_request.title }} From b5072f823c691be974ea2ec4df44ca7173ec81f4 Mon Sep 17 00:00:00 2001 From: Felipe Knorr Kuhn <100320+knorrium@users.noreply.github.com> Date: Thu, 21 Jul 2022 23:04:10 -0700 Subject: [PATCH 2/3] Fix wrong browser var --- .github/workflows/cypress.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/cypress.yml b/.github/workflows/cypress.yml index be7b224d4..d6b93e303 100644 --- a/.github/workflows/cypress.yml +++ b/.github/workflows/cypress.yml @@ -6,7 +6,7 @@ on: jobs: cypress: if: "!contains(github.event.pull_request.labels.*.name, 'ops') && !contains(github.head_ref, 'ops/')" - runs-on: ${{ matrix.os }} + runs-on: "ubuntu-latest" strategy: fail-fast: false matrix: From 68f63683f1439eec0eed4701cc58b9f02410fe65 Mon Sep 17 00:00:00 2001 From: Felipe Knorr Kuhn <100320+knorrium@users.noreply.github.com> Date: Thu, 21 Jul 2022 23:10:41 -0700 Subject: [PATCH 3/3] Remove wrong path setting --- .github/workflows/cypress.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/cypress.yml b/.github/workflows/cypress.yml index d6b93e303..7cace626c 100644 --- a/.github/workflows/cypress.yml +++ b/.github/workflows/cypress.yml @@ -38,7 +38,6 @@ jobs: node-version: 16.15.0 cache: 'npm' cache-dependency-path: ${{ matrix.module }}/frontend/package-lock.json - path: ${{ matrix.module }} - name: Chrome browser tests (${{ matrix.module }}) uses: cypress-io/github-action@v4