Skip to content

Commit

Permalink
feat: summary toggle flag (#106)
Browse files Browse the repository at this point in the history
* dev dependencies fix

* feat: add summary flag

* add ci example without summary
  • Loading branch information
bahmutov authored Oct 5, 2023
1 parent 9db12ed commit ef4b882
Show file tree
Hide file tree
Showing 6 changed files with 996 additions and 715 deletions.
19 changes: 19 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,24 @@ jobs:
SPLIT: ${{ strategy.job-total }}
SPLIT_INDEX: ${{ strategy.job-index }}

test-no-summary:
needs: prepare
runs-on: ubuntu-22.04
steps:
- name: Checkout 🛎
uses: actions/checkout@v4

- name: Run some Cypress tests 🧪
# https://github.com/cypress-io/github-action
uses: cypress-io/github-action@v5
# run half of all specs
env:
SPLIT: 2
# run the second part of the list of specs
SPLIT_INDEX: 1
# do not write summary to github
SPLIT_SUMMARY: false

test-empty:
runs-on: ubuntu-22.04
steps:
Expand Down Expand Up @@ -106,6 +124,7 @@ jobs:
test-spec,
test-workflow-e2e,
test-workflow-component,
test-no-summary,
]
runs-on: ubuntu-22.04
steps:
Expand Down
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,10 @@ job2: npx cypress run --env split=3,splitIndex=1
job3: npx cypress run --env split=3,splitIndex=2
```

## CI summary

To skip GitHub Actions summary, set an environment variable `SPLIT_SUMMARY=false`. By default, this plugin generates the summary.

## Split component specs

Works the same way as splitting E2E specs. Add this plugin to the `setupNodeEvents` callback in the `component` object in the config. See [cypress.config.js](./cypress.config.js) for example:
Expand Down
Loading

0 comments on commit ef4b882

Please sign in to comment.