Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: use containers matrix name in github actions workflow #789

Merged

Conversation

MikeMcC399
Copy link
Contributor

This PR changes the GitHub Actions matrix variable name from machines to containers in the workflow using-action.yml for consistency with the Cypress documentation (docs.cypress.io) and the Cypress GitHub Action repo (github.com/cypress-io/github-action). It also expands on the in-line explanation about the matrix array containers.

Reason for change

Although the workflow previously explained that the items in the matrix did not matter, it has led to some confusion in new users concerning the matrix variable name machines used by the example GitHub Action workflow using-action.yml:

    strategy:
      # when one test fails, DO NOT cancel the other
      # containers, because this will kill Cypress processes
      # leaving the Cypress Cloud dashboard hanging ...
      # https://github.com/cypress-io/github-action/issues/48
      fail-fast: false
      matrix:
        # run 4 copies of the current job in parallel
        # the actual items in the array do not matter
        # we just need to "force" GitHub CI to create 4 jobs
        machines: [1, 2, 3, 4]

The Cypress documentation (docs.cypress.io) and the Cypress GitHub Action repo (github.com/cypress-io/github-action) consistently use the variable

containers

as the name of the matrix array which defines how many parallel jobs are run when recording into Cypress Cloud.

The matrix variable name containers is simply a dummy name, which does not affect how the workflow runs, since the variable name is not used in any substitution. For comparison, in the job parallel-runs-across-platforms, the matrix variable name os and the array contents os: ['ubuntu-22.04', 'windows-latest', 'macos-latest'] are significant and these are used in substitution.

References

@cypress-app-bot
Copy link
Collaborator

@MikeMcC399 MikeMcC399 marked this pull request as ready for review January 31, 2024 18:04
Copy link
Member

@jennifer-shehane jennifer-shehane left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@MikeMcC399 Thanks for the improvement to user experience. The explanation and links to docs are really nice.

@jennifer-shehane jennifer-shehane merged commit a83127f into cypress-io:master Feb 2, 2024
12 checks passed
@cypress-app-bot
Copy link
Collaborator

🎉 This PR is included in version 2.0.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

@MikeMcC399 MikeMcC399 deleted the GHA-parallel-matrix-name branch February 5, 2024 16:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants