diff --git a/.github/workflows/cypress.yaml b/.github/workflows/cypress.yaml index 424d3699b6..fc1dc78dbd 100644 --- a/.github/workflows/cypress.yaml +++ b/.github/workflows/cypress.yaml @@ -41,9 +41,6 @@ jobs: outputs: uuid: ${{ steps.uuid.outputs.value }} pr_id: ${{ steps.prdetails.outputs.pr_id }} - commit_message: ${{ steps.commit.outputs.message }} - commit_author: ${{ steps.commit.outputs.author }} - commit_email: ${{ steps.commit.outputs.email }} percy_enable: ${{ steps.percy.outputs.value || '0' }} steps: # We create the status here and then update it to success/failure in the `report` stage @@ -63,21 +60,6 @@ jobs: owner: ${{ github.event.workflow_run.head_repository.owner.login }} branch: ${{ github.event.workflow_run.head_branch }} - - name: Get commit details - id: commit - if: github.event.workflow_run.event == 'pull_request' || github.event.workflow_run.event == 'merge_group' - uses: actions/github-script@v6 - with: - script: | - const response = await github.rest.git.getCommit({ - owner: context.repo.owner, - repo: context.repo.repo, - commit_sha: "${{ github.event.workflow_run.head_sha }}", - }); - core.setOutput("message", response.data.message); - core.setOutput("author", response.data.author.name); - core.setOutput("email", response.data.author.email); - # Percy is disabled while we're figuring out https://github.com/vector-im/wat-internal/issues/36 # and https://github.com/vector-im/wat-internal/issues/56. We're hoping to turn it back on or switch # to an alternative in the future. @@ -108,11 +90,13 @@ jobs: strategy: fail-fast: false matrix: - # Naive segmentation of tests - segment: ["a-i", "j-p", "q-s", "t-z"] # Run tests using both crypto stacks crypto: [legacy, rust] + ci_node_total: [4] + ci_node_index: [0, 1, 2, 3] steps: + # The version of chrome shipped by default may not be consistent across runners + # so we explicitly use a specific version of chrome here. - uses: browser-actions/setup-chrome@803ef6dfb4fdf22089c9563225d95e4a515820a0 # v1 - run: echo "BROWSER_PATH=$(which chrome)" >> $GITHUB_ENV @@ -154,23 +138,24 @@ jobs: run: | echo "CYPRESS_RUST_CRYPTO=1" >> "$GITHUB_ENV" - - name: Run Cypress tests + - name: Run Cypress tests via knapsack pro uses: cypress-io/github-action@ebe8b24c4428922d0f793a5c4c96853a633180e3 # v6.6.0 with: working-directory: matrix-react-sdk - # The built-in Electron runner seems to grind to a halt trying to run the tests, so use chrome. - browser: ${{ steps.setup-chrome.outputs.chrome-path }} headed: true start: npx serve -p 8080 -L ../webapp wait-on: "http://localhost:8080" - record: true + record: false parallel: false - command-prefix: "yarn percy exec --parallel --" - ci-build-id: ${{ needs.prepare.outputs.uuid }}-${{ matrix.crypto }} - spec: cypress/e2e/[${{ matrix.segment }}]*/** + # The built-in Electron runner seems to grind to a halt trying to run the tests, so use chrome. + command: yarn percy exec --parallel -- npx knapsack-pro-cypress --config trashAssetsBeforeRuns=false --browser "$BROWSER_PATH" env: - # pass the Dashboard record key as an environment variable - CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }} + # Knapsack token and config + KNAPSACK_PRO_TEST_SUITE_TOKEN_CYPRESS: ${{ matrix.crypto == 'rust' && secrets.KNAPSACK_PRO_TEST_SUITE_TOKEN_CYPRESS_RUST || secrets.KNAPSACK_PRO_TEST_SUITE_TOKEN_CYPRESS_LEGACY }} + KNAPSACK_PRO_CI_NODE_TOTAL: ${{ matrix.ci_node_total }} + KNAPSACK_PRO_CI_NODE_INDEX: ${{ matrix.ci_node_index }} + KNAPSACK_PRO_TEST_FILE_PATTERN: cypress/e2e/**/*.spec.ts + KNAPSACK_PRO_BRANCH: ${{ github.event.workflow_run.head_branch }} # Use existing chromium rather than downloading another PUPPETEER_SKIP_CHROMIUM_DOWNLOAD: true @@ -181,16 +166,6 @@ jobs: # make Node's os.tmpdir() return something where we actually have permissions TMPDIR: ${{ runner.temp }} - # tell Cypress more details about the context of this run - COMMIT_INFO_BRANCH: ${{ github.event.workflow_run.head_branch }} - COMMIT_INFO_SHA: ${{ github.event.workflow_run.head_sha }} - COMMIT_INFO_REMOTE: ${{ github.repositoryUrl }} - COMMIT_INFO_MESSAGE: ${{ needs.prepare.outputs.commit_message }} - COMMIT_INFO_AUTHOR: ${{ needs.prepare.outputs.commit_author }} - COMMIT_INFO_EMAIL: ${{ needs.prepare.outputs.commit_email }} - CYPRESS_PULL_REQUEST_ID: ${{ needs.prepare.outputs.pr_id }} - CYPRESS_PULL_REQUEST_URL: https://github.com/${{ github.repository }}/pull/${{ needs.prepare.outputs.pr_id }} - # pass the Percy token as an environment variable PERCY_TOKEN: ${{ secrets.PERCY_TOKEN }} diff --git a/.github/workflows/localazy_download.yaml b/.github/workflows/localazy_download.yaml index 081070dd01..a880c3b2e4 100644 --- a/.github/workflows/localazy_download.yaml +++ b/.github/workflows/localazy_download.yaml @@ -1,6 +1,8 @@ name: Localazy Download on: workflow_dispatch: {} + schedule: + - cron: "0 6 * * 1,3,5" # Every Monday, Wednesday and Friday at 6am UTC jobs: download: uses: matrix-org/matrix-web-i18n/.github/workflows/localazy_download.yaml@main diff --git a/.github/workflows/release-drafter.yml b/.github/workflows/release-drafter.yml index 3ce2b5a2af..4d889f4561 100644 --- a/.github/workflows/release-drafter.yml +++ b/.github/workflows/release-drafter.yml @@ -2,13 +2,20 @@ name: Release Drafter on: push: branches: [staging] + workflow_dispatch: + inputs: + previous-version: + description: What release to use as a base for release note purposes + required: false + type: string concurrency: ${{ github.workflow }} jobs: draft: runs-on: ubuntu-latest steps: - - uses: release-drafter/release-drafter@dabcf3767562210392d862070ed2ef6434b9bc6f # v5 + - uses: release-drafter/release-drafter@e64b19c4c46173209ed9f2e5a2f4ca7de89a0e86 # v5 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: disable-autolabeler: true + previous-version: ${{ inputs.previous-version }} diff --git a/README.md b/README.md index 39d1f600e2..ffb516b90a 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,8 @@ [![npm](https://img.shields.io/npm/v/matrix-react-sdk)](https://www.npmjs.com/package/matrix-react-sdk) ![Tests](https://github.com/matrix-org/matrix-react-sdk/actions/workflows/tests.yml/badge.svg) ![Static Analysis](https://github.com/matrix-org/matrix-react-sdk/actions/workflows/static_analysis.yaml/badge.svg) -[![matrix-react-sdk](https://img.shields.io/endpoint?url=https://dashboard.cypress.io/badge/simple/ppvnzg/develop&style=flat&logo=cypress)](https://dashboard.cypress.io/projects/ppvnzg/runs) +[![Knapsack Pro Parallel CI builds for Cypress Test - Legacy Crypto](https://img.shields.io/badge/Knapsack%20Pro-Parallel%20%2F%20Cypress%20Test%20--%20Legacy%20Crypto-%230074ff)](https://knapsackpro.com/dashboard/organizations/3882/projects/2469/test_suites/3724/builds?utm_campaign=organization-id-3882&utm_content=test-suite-id-3724&utm_medium=readme&utm_source=knapsack-pro-badge&utm_term=project-id-2469) +[![Knapsack Pro Parallel CI builds for Cypress Test - Rust Crypto](https://img.shields.io/badge/Knapsack%20Pro-Parallel%20%2F%20Cypress%20Test%20--%20Rust%20Crypto-%230074ff)](https://knapsackpro.com/dashboard/organizations/3882/projects/2469/test_suites/3729/builds?utm_campaign=organization-id-3882&utm_content=test-suite-id-3729&utm_medium=readme&utm_source=knapsack-pro-badge&utm_term=project-id-2469)