From 9488714fa9b077d54de38d66c59c491732f2ef47 Mon Sep 17 00:00:00 2001 From: Simen Bekkhus Date: Tue, 20 Oct 2020 11:14:38 +0200 Subject: [PATCH] chore: run tests in parallel on GitHub Actions (#10653) --- .github/workflows/nodejs.yml | 5 ++++- package.json | 3 ++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/nodejs.yml b/.github/workflows/nodejs.yml index 3acae63e2f87..c54471099b64 100644 --- a/.github/workflows/nodejs.yml +++ b/.github/workflows/nodejs.yml @@ -83,7 +83,10 @@ jobs: run: yarn - name: build run: yarn build:js + - name: Get number of CPU cores + id: cpu-cores + uses: SimenB/github-actions-cpu-cores@v1 - name: run tests - run: yarn test-ci-partial + run: yarn test-ci-partial:parallel --max-workers ${{ steps.cpu-cores.outputs.count }} env: CI: true diff --git a/package.json b/package.json index 899223832694..3edb1c25d211 100644 --- a/package.json +++ b/package.json @@ -98,7 +98,8 @@ "publish": "yarn build-clean && yarn build && lerna publish --silent", "test-types": "yarn jest --config jest.config.types.js", "test-ci": "yarn jest-coverage --color -i --config jest.config.ci.js && yarn test-leak && node ./scripts/mapCoverage.js && codecov", - "test-ci-partial": "yarn jest --color -i --config jest.config.ci.js", + "test-ci-partial": "yarn test-ci-partial:parallel -i", + "test-ci-partial:parallel": "yarn jest --color --config jest.config.ci.js", "test-pretty-format-perf": "node packages/pretty-format/perf/test.js", "test-leak": "yarn jest -i --detectLeaks jest-mock jest-diff jest-repl pretty-format", "test": "yarn lint && yarn jest",