mirror of https://github.com/facebook/jest.git
chore: run test coverage on GH actions (#12393)
This commit is contained in:
parent
49f217c344
commit
16f1a60c57
|
@ -19,9 +19,6 @@ jobs:
|
||||||
parameters:
|
parameters:
|
||||||
node-version:
|
node-version:
|
||||||
type: string
|
type: string
|
||||||
partial:
|
|
||||||
type: boolean
|
|
||||||
default: false
|
|
||||||
working_directory: ~/jest
|
working_directory: ~/jest
|
||||||
executor: node/default
|
executor: node/default
|
||||||
steps:
|
steps:
|
||||||
|
@ -29,16 +26,8 @@ jobs:
|
||||||
- node/install:
|
- node/install:
|
||||||
node-version: << parameters.node-version >>
|
node-version: << parameters.node-version >>
|
||||||
- node/install-packages: *install
|
- node/install-packages: *install
|
||||||
- when:
|
- run:
|
||||||
condition: << parameters.partial >>
|
command: yarn test-ci-partial
|
||||||
steps:
|
|
||||||
- run:
|
|
||||||
command: yarn test-ci-partial
|
|
||||||
- unless:
|
|
||||||
condition: << parameters.partial >>
|
|
||||||
steps:
|
|
||||||
- run:
|
|
||||||
command: yarn test-ci
|
|
||||||
- store_test_results:
|
- store_test_results:
|
||||||
path: reports/junit
|
path: reports/junit
|
||||||
|
|
||||||
|
@ -59,14 +48,9 @@ jobs:
|
||||||
workflows:
|
workflows:
|
||||||
build-and-deploy:
|
build-and-deploy:
|
||||||
jobs:
|
jobs:
|
||||||
- test-node:
|
|
||||||
matrix:
|
|
||||||
parameters:
|
|
||||||
node-version: ['lts/*']
|
|
||||||
- test-node:
|
- test-node:
|
||||||
name: test-node-partial-<< matrix.node-version >>
|
name: test-node-partial-<< matrix.node-version >>
|
||||||
partial: true
|
|
||||||
matrix:
|
matrix:
|
||||||
parameters:
|
parameters:
|
||||||
node-version: ['12', '14', '17']
|
node-version: ['12', '14', '16', '17']
|
||||||
- test-jest-jasmine
|
- test-jest-jasmine
|
||||||
|
|
|
@ -0,0 +1,13 @@
|
||||||
|
codecov:
|
||||||
|
require_ci_to_pass: false
|
||||||
|
|
||||||
|
comment: false
|
||||||
|
|
||||||
|
coverage:
|
||||||
|
status:
|
||||||
|
patch:
|
||||||
|
default:
|
||||||
|
target: auto
|
||||||
|
project:
|
||||||
|
default:
|
||||||
|
target: auto
|
|
@ -133,3 +133,34 @@ jobs:
|
||||||
uses: SimenB/github-actions-cpu-cores@v1
|
uses: SimenB/github-actions-cpu-cores@v1
|
||||||
- name: run tests using jest-jasmine
|
- name: run tests using jest-jasmine
|
||||||
run: yarn jest-jasmine-ci --max-workers ${{ steps.cpu-cores.outputs.count }}
|
run: yarn jest-jasmine-ci --max-workers ${{ steps.cpu-cores.outputs.count }}
|
||||||
|
|
||||||
|
test-coverage:
|
||||||
|
name: Node LTS on Ubuntu with coverage
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
needs: prepare-yarn-cache
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
- name: Use Node.js LTS
|
||||||
|
uses: actions/setup-node@v2
|
||||||
|
with:
|
||||||
|
node-version: lts/*
|
||||||
|
cache: yarn
|
||||||
|
- name: install
|
||||||
|
run: yarn --immutable
|
||||||
|
- 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 with coverage
|
||||||
|
run: |
|
||||||
|
yarn jest-coverage --color --config jest.config.ci.js --max-workers ${{ steps.cpu-cores.outputs.count }}
|
||||||
|
yarn test-leak
|
||||||
|
- name: map coverage
|
||||||
|
run: node ./scripts/mapCoverage.js
|
||||||
|
if: always()
|
||||||
|
- uses: codecov/codecov-action@v2
|
||||||
|
if: always()
|
||||||
|
with:
|
||||||
|
directory: ./coverage
|
||||||
|
|
|
@ -29,7 +29,6 @@
|
||||||
"camelcase": "^6.2.0",
|
"camelcase": "^6.2.0",
|
||||||
"chalk": "^4.0.0",
|
"chalk": "^4.0.0",
|
||||||
"chokidar": "^3.3.0",
|
"chokidar": "^3.3.0",
|
||||||
"codecov": "^3.0.0",
|
|
||||||
"debug": "^4.0.1",
|
"debug": "^4.0.1",
|
||||||
"dedent": "^0.7.0",
|
"dedent": "^0.7.0",
|
||||||
"eslint": "^8.8.0",
|
"eslint": "^8.8.0",
|
||||||
|
@ -104,11 +103,10 @@
|
||||||
"lint:prettier:ci": "prettier '**/*.{md,yml,yaml}' 'website/**/*.{css,js}' --check --ignore-path .gitignore",
|
"lint:prettier:ci": "prettier '**/*.{md,yml,yaml}' 'website/**/*.{css,js}' --check --ignore-path .gitignore",
|
||||||
"remove-examples": "node ./scripts/remove-examples.js",
|
"remove-examples": "node ./scripts/remove-examples.js",
|
||||||
"test-types": "yarn jest --config jest.config.tsd.js",
|
"test-types": "yarn jest --config jest.config.tsd.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 test-ci-partial:parallel -i",
|
"test-ci-partial": "yarn test-ci-partial:parallel -i",
|
||||||
"test-ci-partial:parallel": "yarn jest --color --config jest.config.ci.js",
|
"test-ci-partial:parallel": "yarn jest --color --config jest.config.ci.js",
|
||||||
"test-pretty-format-perf": "node packages/pretty-format/perf/test.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-leak": "yarn jest -i --detectLeaks --color jest-mock jest-diff jest-repl pretty-format",
|
||||||
"test": "yarn lint && yarn jest",
|
"test": "yarn lint && yarn jest",
|
||||||
"verify-old-ts": "node ./scripts/verifyOldTs.js",
|
"verify-old-ts": "node ./scripts/verifyOldTs.js",
|
||||||
"verify-pnp": "node ./scripts/verifyPnP.js",
|
"verify-pnp": "node ./scripts/verifyPnP.js",
|
||||||
|
|
67
yarn.lock
67
yarn.lock
|
@ -2647,7 +2647,6 @@ __metadata:
|
||||||
camelcase: ^6.2.0
|
camelcase: ^6.2.0
|
||||||
chalk: ^4.0.0
|
chalk: ^4.0.0
|
||||||
chokidar: ^3.3.0
|
chokidar: ^3.3.0
|
||||||
codecov: ^3.0.0
|
|
||||||
debug: ^4.0.1
|
debug: ^4.0.1
|
||||||
dedent: ^0.7.0
|
dedent: ^0.7.0
|
||||||
eslint: ^8.8.0
|
eslint: ^8.8.0
|
||||||
|
@ -6268,13 +6267,6 @@ __metadata:
|
||||||
languageName: node
|
languageName: node
|
||||||
linkType: hard
|
linkType: hard
|
||||||
|
|
||||||
"argv@npm:0.0.2":
|
|
||||||
version: 0.0.2
|
|
||||||
resolution: "argv@npm:0.0.2"
|
|
||||||
checksum: e703f1af475dfd35f4065c21d7324368e3a9f1b5ff63d49c11fd442155aa0fd4f8498b57b535947fac86b79e1c9913cf0324300cbddbdc0af92fcf62eac0f5d2
|
|
||||||
languageName: node
|
|
||||||
linkType: hard
|
|
||||||
|
|
||||||
"aria-query@npm:^5.0.0":
|
"aria-query@npm:^5.0.0":
|
||||||
version: 5.0.0
|
version: 5.0.0
|
||||||
resolution: "aria-query@npm:5.0.0"
|
resolution: "aria-query@npm:5.0.0"
|
||||||
|
@ -7702,21 +7694,6 @@ __metadata:
|
||||||
languageName: node
|
languageName: node
|
||||||
linkType: hard
|
linkType: hard
|
||||||
|
|
||||||
"codecov@npm:^3.0.0":
|
|
||||||
version: 3.8.2
|
|
||||||
resolution: "codecov@npm:3.8.2"
|
|
||||||
dependencies:
|
|
||||||
argv: 0.0.2
|
|
||||||
ignore-walk: 3.0.3
|
|
||||||
js-yaml: 3.14.1
|
|
||||||
teeny-request: 7.0.1
|
|
||||||
urlgrey: 0.4.4
|
|
||||||
bin:
|
|
||||||
codecov: bin/codecov
|
|
||||||
checksum: a70fdf2e83dace9018747781e63a564c935784ab62df966eebe7f6bacfd004a6f8b0c271fc9814fea21726e118501c35a05d65c74770b0573760c96e5dfa04d9
|
|
||||||
languageName: node
|
|
||||||
linkType: hard
|
|
||||||
|
|
||||||
"collapse-white-space@npm:^1.0.2":
|
"collapse-white-space@npm:^1.0.2":
|
||||||
version: 1.0.6
|
version: 1.0.6
|
||||||
resolution: "collapse-white-space@npm:1.0.6"
|
resolution: "collapse-white-space@npm:1.0.6"
|
||||||
|
@ -11845,7 +11822,7 @@ __metadata:
|
||||||
languageName: node
|
languageName: node
|
||||||
linkType: hard
|
linkType: hard
|
||||||
|
|
||||||
"http-proxy-agent@npm:^4.0.0, http-proxy-agent@npm:^4.0.1":
|
"http-proxy-agent@npm:^4.0.1":
|
||||||
version: 4.0.1
|
version: 4.0.1
|
||||||
resolution: "http-proxy-agent@npm:4.0.1"
|
resolution: "http-proxy-agent@npm:4.0.1"
|
||||||
dependencies:
|
dependencies:
|
||||||
|
@ -11974,7 +11951,7 @@ __metadata:
|
||||||
languageName: node
|
languageName: node
|
||||||
linkType: hard
|
linkType: hard
|
||||||
|
|
||||||
"ignore-walk@npm:3.0.3, ignore-walk@npm:^3.0.3":
|
"ignore-walk@npm:^3.0.3":
|
||||||
version: 3.0.3
|
version: 3.0.3
|
||||||
resolution: "ignore-walk@npm:3.0.3"
|
resolution: "ignore-walk@npm:3.0.3"
|
||||||
dependencies:
|
dependencies:
|
||||||
|
@ -13746,7 +13723,7 @@ __metadata:
|
||||||
languageName: node
|
languageName: node
|
||||||
linkType: hard
|
linkType: hard
|
||||||
|
|
||||||
"js-yaml@npm:3.14.1, js-yaml@npm:^3.13.1":
|
"js-yaml@npm:^3.13.1":
|
||||||
version: 3.14.1
|
version: 3.14.1
|
||||||
resolution: "js-yaml@npm:3.14.1"
|
resolution: "js-yaml@npm:3.14.1"
|
||||||
dependencies:
|
dependencies:
|
||||||
|
@ -20548,15 +20525,6 @@ __metadata:
|
||||||
languageName: node
|
languageName: node
|
||||||
linkType: hard
|
linkType: hard
|
||||||
|
|
||||||
"stream-events@npm:^1.0.5":
|
|
||||||
version: 1.0.5
|
|
||||||
resolution: "stream-events@npm:1.0.5"
|
|
||||||
dependencies:
|
|
||||||
stubs: ^3.0.0
|
|
||||||
checksum: 969ce82e34bfbef5734629cc06f9d7f3705a9ceb8fcd6a526332f9159f1f8bbfdb1a453f3ced0b728083454f7706adbbe8428bceb788a0287ca48ba2642dc3fc
|
|
||||||
languageName: node
|
|
||||||
linkType: hard
|
|
||||||
|
|
||||||
"strict-uri-encode@npm:^2.0.0":
|
"strict-uri-encode@npm:^2.0.0":
|
||||||
version: 2.0.0
|
version: 2.0.0
|
||||||
resolution: "strict-uri-encode@npm:2.0.0"
|
resolution: "strict-uri-encode@npm:2.0.0"
|
||||||
|
@ -20803,13 +20771,6 @@ __metadata:
|
||||||
languageName: node
|
languageName: node
|
||||||
linkType: hard
|
linkType: hard
|
||||||
|
|
||||||
"stubs@npm:^3.0.0":
|
|
||||||
version: 3.0.0
|
|
||||||
resolution: "stubs@npm:3.0.0"
|
|
||||||
checksum: dec7b82186e3743317616235c59bfb53284acc312cb9f4c3e97e2205c67a5c158b0ca89db5927e52351582e90a2672822eeaec9db396e23e56893d2a8676e024
|
|
||||||
languageName: node
|
|
||||||
linkType: hard
|
|
||||||
|
|
||||||
"style-to-object@npm:0.3.0, style-to-object@npm:^0.3.0":
|
"style-to-object@npm:0.3.0, style-to-object@npm:^0.3.0":
|
||||||
version: 0.3.0
|
version: 0.3.0
|
||||||
resolution: "style-to-object@npm:0.3.0"
|
resolution: "style-to-object@npm:0.3.0"
|
||||||
|
@ -20969,19 +20930,6 @@ __metadata:
|
||||||
languageName: node
|
languageName: node
|
||||||
linkType: hard
|
linkType: hard
|
||||||
|
|
||||||
"teeny-request@npm:7.0.1":
|
|
||||||
version: 7.0.1
|
|
||||||
resolution: "teeny-request@npm:7.0.1"
|
|
||||||
dependencies:
|
|
||||||
http-proxy-agent: ^4.0.0
|
|
||||||
https-proxy-agent: ^5.0.0
|
|
||||||
node-fetch: ^2.6.1
|
|
||||||
stream-events: ^1.0.5
|
|
||||||
uuid: ^8.0.0
|
|
||||||
checksum: 8eba49422edc141cff2c4a4c2bc39c78d92b6a9ce0fbf1a9edd0d3a57b830f719a1030a5681c2890a7d222c7ebcb74b7a8c29b37ad7b124d34be728cacfd128b
|
|
||||||
languageName: node
|
|
||||||
linkType: hard
|
|
||||||
|
|
||||||
"temp-dir@npm:^1.0.0":
|
"temp-dir@npm:^1.0.0":
|
||||||
version: 1.0.0
|
version: 1.0.0
|
||||||
resolution: "temp-dir@npm:1.0.0"
|
resolution: "temp-dir@npm:1.0.0"
|
||||||
|
@ -22087,13 +22035,6 @@ __metadata:
|
||||||
languageName: node
|
languageName: node
|
||||||
linkType: hard
|
linkType: hard
|
||||||
|
|
||||||
"urlgrey@npm:0.4.4":
|
|
||||||
version: 0.4.4
|
|
||||||
resolution: "urlgrey@npm:0.4.4"
|
|
||||||
checksum: db5884ffca497430eb99fcf7bd88402ff3647c1ba7b5687c595d3af884afc198399301ec181582501ff61074d9bf342ad12825eb11aa020bc6aeae7bc815a04c
|
|
||||||
languageName: node
|
|
||||||
linkType: hard
|
|
||||||
|
|
||||||
"use-composed-ref@npm:^1.0.0":
|
"use-composed-ref@npm:^1.0.0":
|
||||||
version: 1.2.1
|
version: 1.2.1
|
||||||
resolution: "use-composed-ref@npm:1.2.1"
|
resolution: "use-composed-ref@npm:1.2.1"
|
||||||
|
@ -22193,7 +22134,7 @@ __metadata:
|
||||||
languageName: node
|
languageName: node
|
||||||
linkType: hard
|
linkType: hard
|
||||||
|
|
||||||
"uuid@npm:^8.0.0, uuid@npm:^8.3.1, uuid@npm:^8.3.2":
|
"uuid@npm:^8.3.1, uuid@npm:^8.3.2":
|
||||||
version: 8.3.2
|
version: 8.3.2
|
||||||
resolution: "uuid@npm:8.3.2"
|
resolution: "uuid@npm:8.3.2"
|
||||||
bin:
|
bin:
|
||||||
|
|
Loading…
Reference in New Issue