Skip to content
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

Add build step to CI #499

Merged
merged 3 commits into from
Apr 24, 2017
Merged

Add build step to CI #499

merged 3 commits into from
Apr 24, 2017

Conversation

BE-Webdesign
Copy link
Contributor

Fixes #481. Adds the build step to Travis CI. Since we are using
webpack v2, the build will exit with a non zero error code, if any build
failures occur.

Fixes #481. Adds the build step to Travis CI.  Since we are using
webpack v2, the build will exit with a non zero error code, if any build
failures occur.
@aduth
Copy link
Member

aduth commented Apr 24, 2017

I think this is reasonable, but also worrying that our production build is different enough from what we're testing that we feel compelled to create separate tasks for them in CI.

@aduth
Copy link
Member

aduth commented Apr 24, 2017

I also wonder if these tasks can be parallelized to speed up the Travis build.

@aduth
Copy link
Member

aduth commented Apr 24, 2017

To the last point, we could consider: https://www.npmjs.com/package/concurrently

@BE-Webdesign
Copy link
Contributor Author

BE-Webdesign commented Apr 24, 2017

Okay, so run the dev build as well and run them in parallel, along with the test suite?

@BE-Webdesign
Copy link
Contributor Author

BE-Webdesign commented Apr 24, 2017

Should I create seperate npm scripts for each build, to make it a little cleaner looking? Or potentially just a script that will take the environment as an argument and then use the same script with the three different environments?

.travis.yml Outdated
@@ -1,3 +1,5 @@
language: node_js
node_js:
- "node"
before_script:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thinking since we're customizing the build so much at this point we may as well override script instead of defining as before_script, then move all tasks (including default test) into a new ci npm script.

package.json Outdated
@@ -15,7 +15,8 @@
"build": "cross-env BABEL_ENV=default NODE_ENV=production webpack",
"lint": "eslint .",
"dev": "cross-env BABEL_ENV=default webpack --watch",
"test": "npm run lint && npm run test-unit"
"test": "npm run lint && npm run test-unit",
"travis-builds": "concurrently \"npm run build\" \"cross-env BABEL_ENV=default webpack\" \"cross-env BABEL_ENV=default NODE_ENV=test webpack\""
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know that we need to build all the environments. I think this could be simplified to:

"ci": "concurrently \"npm run build\" \"npm test\""

(Assuming script instead of before_script per my previous suggestion)

Aside: How do you feel about the ci name suggestion here? I don't really have a strong preference; seemed simpler and less specific to any one CI tool in case we'd ever change.

Can we also fix the whitespace here to use spaces instead of tabs? Spaces are an exception for this file because the default behavior of npm install --save (and --save-dev) will use spaces anyways. We define an EditorConfig configuration for the project which enforces this (source). Installing a plugin for your editor will avoid the need for you to account for this manually.

Copy link
Contributor Author

@BE-Webdesign BE-Webdesign Apr 24, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can't use npm test persee only test env as test has the --watch flag which will not error properly to fail the CI build.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wait nvm confusing that with dev.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch on the tab as well :). Those sound like good changes.

@BE-Webdesign
Copy link
Contributor Author

@aduth Should be good now.

Copy link
Member

@aduth aduth left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good and Travis seems to happily pass with the new changes. Thanks! 👍

@aduth aduth merged commit 60e13a4 into master Apr 24, 2017
@aduth aduth deleted the build-step-in-ci branch April 24, 2017 20:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants