Skip to content

Commit 15336ad

Browse files
committed
Run separate lint and unit jobs with CircleCI
1 parent eccba63 commit 15336ad

File tree

4 files changed

+35
-4
lines changed

4 files changed

+35
-4
lines changed

.circleci/config.yml

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,12 +32,23 @@ jobs:
3232
- node_modules
3333
key: build-v1-{{ .Branch }}-{{ .Revision }}
3434

35-
test:
35+
lint:
3636
<<: *defaults
3737
steps:
3838
- checkout
3939
- *restore-build
40-
- run: yarn test
40+
- run: yarn test:lint:ci
41+
- store_test_results:
42+
path: reports
43+
44+
unit:
45+
<<: *defaults
46+
steps:
47+
- checkout
48+
- *restore-build
49+
- run: yarn test:unit:ci
50+
- store_test_results:
51+
path: reports
4152

4253
dist:
4354
<<: *defaults
@@ -64,12 +75,16 @@ workflows:
6475
package:
6576
jobs:
6677
- build
67-
- test:
78+
- lint:
79+
requires:
80+
- build
81+
- unit:
6882
requires:
6983
- build
7084
- dist:
7185
requires:
72-
- test
86+
- lint
87+
- unit
7388
- build
7489
filters:
7590
branches:

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55

66
# testing
77
/coverage
8+
/reports
89

910
# production
1011
/build

package.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
"eslint-plugin-jsx-a11y": "^6.0.2",
1717
"eslint-plugin-prettier": "^2.6.0",
1818
"eslint-plugin-react": "^7.4.0",
19+
"jest-junit": "^3.6.0",
1920
"prettier": "^1.11.1",
2021
"react-scripts": "1.1.1"
2122
},
@@ -25,7 +26,9 @@
2526
"build": "react-scripts build",
2627
"test": "yarn test:lint && yarn test:unit",
2728
"test:unit": "react-scripts test --env=jsdom",
29+
"test:unit:ci": "CI=true JEST_JUNIT_OUTPUT=reports/jest-junit.xml react-scripts test --testResultsProcessor ./node_modules/jest-junit --env=jsdom",
2830
"test:lint": "eslint ./src",
31+
"test:lint:ci": "eslint ./src --format junit -o reports/eslint-junit.xml",
2932
"eject": "react-scripts eject"
3033
}
3134
}

yarn.lock

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4112,6 +4112,14 @@ jest-jasmine2@^20.0.4:
41124112
once "^1.4.0"
41134113
p-map "^1.1.1"
41144114

4115+
jest-junit@^3.6.0:
4116+
version "3.6.0"
4117+
resolved "https://registry.yarnpkg.com/jest-junit/-/jest-junit-3.6.0.tgz#f4c4358e5286364a4324dc14abddd526aadfbd38"
4118+
dependencies:
4119+
mkdirp "^0.5.1"
4120+
strip-ansi "^4.0.0"
4121+
xml "^1.0.1"
4122+
41154123
jest-matcher-utils@^20.0.3:
41164124
version "20.0.3"
41174125
resolved "https://registry.yarnpkg.com/jest-matcher-utils/-/jest-matcher-utils-20.0.3.tgz#b3a6b8e37ca577803b0832a98b164f44b7815612"
@@ -7420,6 +7428,10 @@ xml-name-validator@^2.0.1:
74207428
version "2.0.1"
74217429
resolved "https://registry.yarnpkg.com/xml-name-validator/-/xml-name-validator-2.0.1.tgz#4d8b8f1eccd3419aa362061becef515e1e559635"
74227430

7431+
xml@^1.0.1:
7432+
version "1.0.1"
7433+
resolved "https://registry.yarnpkg.com/xml/-/xml-1.0.1.tgz#78ba72020029c5bc87b8a81a3cfcd74b4a2fc1e5"
7434+
74237435
xtend@^4.0.0, xtend@~4.0.1:
74247436
version "4.0.1"
74257437
resolved "https://registry.yarnpkg.com/xtend/-/xtend-4.0.1.tgz#a5c6d532be656e23db820efb943a1f04998d63af"

0 commit comments

Comments
 (0)