Skip to content

Commit

Permalink
Remove advice to use NCPUs jobs
Browse files Browse the repository at this point in the history
This is generally too many, because cargo and tests can start so many
threads.
  • Loading branch information
sourcefrog committed Nov 25, 2023
1 parent e1155e6 commit ff14f55
Showing 1 changed file with 0 additions and 34 deletions.
34 changes: 0 additions & 34 deletions book/src/ci.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,37 +29,3 @@ jobs:
The workflow used by cargo-mutants on itself can be seen at
<https://github.com/sourcefrog/cargo-mutants/blob/main/.github/workflows/mutate-self.yaml>.
## Parallelism
If you'd like cargo-mutants to run in parallel (see [parallelism](parallelism.md) for more information) in CI, you can do the following:
```yml
name: cargo-mutants

on: [pull_request, push]

jobs:
cargo-mutants:
runs-on: ubuntu-latest
steps:
- name: Get number of CPU cores
uses: SimenB/github-actions-cpu-cores@v1
id: cpu-cores
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
- name: Install cargo-mutants
run: cargo install --locked cargo-mutants
- name: Run mutant tests
run: cargo mutants --jobs ${{ steps.cpu-cores.outputs.count }} -- --all-features
- name: Archive results
uses: actions/upload-artifact@v3
if: failure()
with:
name: mutation-report
path: mutants.out
```
This will automatically use the maximum number of CPU cores available. However, it's possible that this will result in flakiness due to OOM errors in the VM.

0 comments on commit ff14f55

Please sign in to comment.