Skip to content

Commit

Permalink
Allow Jest --maxWorkers=2 on Windows again
Browse files Browse the repository at this point in the history
Without the Review app we have more Windows CPU time and can remove the `--maxWorkers=1` limit added in 87e4b2c

Keeping Jest `--maxWorkers=1` on Windows

1) 9m 53s
2) 7m 17s
3) 7m 40s
4) 7m 38s

Restoring Jest `--maxWorkers=2` on Windows

1) 7m 56s
2) 6m 17s
3) 6m 58s
4) 6m 39s
  • Loading branch information
colinrotherham committed Nov 2, 2023
1 parent c8a10cd commit b2c68f7
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -123,11 +123,6 @@ jobs:
runs-on: ${{ matrix.runner }}
needs: [install, build]

env:
# Use 2x CPU cores unless on Windows (runs slower when concurrent)
# https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners#supported-runners-and-hardware-resources
MAX_WORKERS: ${{ matrix.runner == 'windows-latest' && '1' || '2' }}

strategy:
fail-fast: false

Expand Down Expand Up @@ -193,7 +188,10 @@ jobs:
path: ${{ matrix.task.cache }}

- name: Run test task
run: npx jest --color ${{ format('--coverage={0} --maxWorkers={1} --selectProjects "{2}"', matrix.task.coverage || false, env.MAX_WORKERS, join(matrix.task.projects, '", "')) }}

# Use 2x CPU cores for hosted GitHub runners
# https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners/about-github-hosted-runners#supported-runners-and-hardware-resources
run: npx jest --color ${{ format('--coverage={0} --maxWorkers=2 --selectProjects "{1}"', matrix.task.coverage || false, join(matrix.task.projects, '", "')) }}

- name: Save test coverage
uses: actions/upload-artifact@v3.1.3
Expand Down

0 comments on commit b2c68f7

Please sign in to comment.