-
Notifications
You must be signed in to change notification settings - Fork 215
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ci: Travis build speed improvements #504
Changes from all commits
b634934
d812656
1974a3b
586c956
913bfc1
279558d
341f6a0
0e2c456
40a4102
026480c
dcc4f03
f7610df
3f23e3b
c90bb60
8e1df02
6416cb5
138fd3f
3217ca8
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,10 +10,9 @@ addons: | |
packages: | ||
- libgconf-2-4 | ||
|
||
# cache both yarn and Cypress binar | ||
# also cache TypeScript builds, this only rebuilds when code changes | ||
# cache both yarn and Cypress binary | ||
cache: | ||
yarn: true | ||
npm: false # Caching npm makes yarn install faster but downloading and packaging up the cache makes this slower when enabled | ||
directories: | ||
- ~/.cache | ||
|
||
|
@@ -35,23 +34,23 @@ before_install: | |
- export PATH="$HOME/.yarn/bin:$PATH" | ||
|
||
install: | ||
- yarn install --production=false | ||
- yarn install | ||
|
||
jobs: | ||
include: | ||
- stage: pull_request | ||
script: | ||
- >- | ||
yarn concurrently | ||
"yarn lint" | ||
"yarn depcheck" | ||
"yarn test" | ||
yarn run-p -l | ||
lint | ||
depcheck | ||
test | ||
- >- # Chromatic and Cypress rely on Storybook being built, this will exit early if build-storybook fails | ||
yarn build-storybook && | ||
yarn http-server docs -p 9001 & yarn wait-on http://localhost:9001 && | ||
yarn concurrently | ||
"yarn chromatic --quiet --exit-zero-on-changes --storybook-build-dir docs" | ||
"yarn cypress run --record" && | ||
yarn http-server docs -p 9001 & npx wait-on http://localhost:9001 && | ||
yarn run-p -l | ||
"chromatic -- --quiet --exit-zero-on-changes --exit-once-uploaded --storybook-build-dir docs" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Most of the work is done on Chromatic's side so this allows us to make our Chromatic build command exit after we've uploaded the Storybook source. This also ensures that we don't incur CI build time increases in Travis as we add more visual testing stories. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Genius. I didn't matter much when we only had Chrome and it took like 15s for 300 stories. IE11 is much slower. We already have a status check that is reported by Chromatic. We don't need to wait for it here. 👍 |
||
"cypress:run -- --record" && | ||
kill $(jobs -p) || true | ||
env: | ||
# Travis doesn't support encryption on forks: https://docs.travis-ci.com/user/pull-requests#pull-requests-and-security-restrictions | ||
|
@@ -74,7 +73,7 @@ jobs: | |
script: | ||
- >- # Chromatic relies on a built Storybook, so exit early if build-storybook fails | ||
yarn build-storybook && | ||
yarn chromatic --quiet --auto-accept-changes --storybook-build-dir docs | ||
yarn chromatic --quiet --auto-accept-changes --exit-once-uploaded --storybook-build-dir docs | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 👍 |
||
- yarn build | ||
env: | ||
- CHROMATIC_APP_CODE="dlpro96xybh" | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -55,7 +55,6 @@ | |
"babel-plugin-transform-es2015-modules-commonjs": "^6.26.2", | ||
"colors": "^1.4.0", | ||
"commitizen": "^3.1.1", | ||
"concurrently": "^5.1.0", | ||
"core-js": "^3.5.0", | ||
"css-loader": "^3.2.0", | ||
"css-mqpacker": "^7.0.0", | ||
|
@@ -123,8 +122,7 @@ | |
"tslint": "^5.20.0", | ||
"tslint-config-prettier": "^1.14.0", | ||
"tslint-react": "^3.6.0", | ||
"typescript": "^3.5.1", | ||
"wait-on": "^4.0.1" | ||
"typescript": "^3.5.1" | ||
}, | ||
"scripts": { | ||
"start": "node --max-old-space-size=2048 node_modules/.bin/start-storybook -p 9001 -c .storybook", | ||
|
@@ -137,6 +135,7 @@ | |
"create-module": "./utils/create-component/createComponent.js", | ||
"create-component": "./utils/create-component/createComponent.js", | ||
"precommit": "lint-staged", | ||
"chromatic": "chromatic", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Need this to run chromatic via |
||
"commit": "git-cz", | ||
"commitmsg": "commitlint --edit $HUSKY_GIT_PARAMS", | ||
"build-storybook": "build-storybook -c .storybook -o docs", | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For some reason,
concurrently
is about 40mb andnpm-run-all/run-p
pretty much do the same thing at a fraction of the size.