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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update the travis build to work in stages #948

Merged
merged 5 commits into from Aug 27, 2018

Conversation

2 participants
@ericcornelissen
Copy link
Contributor

ericcornelissen commented Aug 26, 2018

Improve the CI (test, build, and deploy) process by using build stages rather than a (somewhat hard to understand and arbitrary) build matrix. For now it just improves the readability of the .travis.yml file and the understandability of the build status page.

For clarity, I added two commits showing the build report when something goes wrong. The first is when the website cannot be build, and the second is when there is a linting error. As seen in the images below:

build website error

linting error


To summarize, Travis will now first lint & build the website (in parallel), and only if both succeed will it try to deploy. That only happens if the commit is on master. So it is ignored most of the time, as seen here.

In the future, with #898 in mind, this would make it easier to build to website in one step, and have it be deployed in another one (if that is even needed 馃), Possibly we could even load external files (e.g. simple-icons-pdf), and include them in the website. Also, extra test steps (such as described in #905) are now easier to add.

@ericcornelissen ericcornelissen force-pushed the ericcornelissen:tools/ci-stages branch 4 times, most recently from 16430ea to 8339aea Aug 26, 2018

@ericcornelissen ericcornelissen force-pushed the ericcornelissen:tools/ci-stages branch from 8339aea to 038504e Aug 26, 2018

ericcornelissen added some commits Aug 26, 2018

@ericcornelissen ericcornelissen changed the title [WIP] Update the travis build to work in stages Update the travis build to work in stages Aug 26, 2018

@birjolaxew
Copy link
Member

birjolaxew left a comment

Great idea!

Note that when it comes to building and deploying in two separate stages, storage isn't shared amongst stages - this means that although we can (and should) use a single stage for testing that the build works, we will also have to run the build in the deploy stage.

[Edit] Whoops, didn't submit the inline comment. Guess it'll have to be here instead.
Minor thing, but could we add a conditional branch = master to the deploy stage, so that PRs targetting develop don't run an empty stage?

Conditional deplay stage, only on master
So PRs targetting develop don't run an empty stage.

Related Travis Documentation:
https://docs.travis-ci.com/user/conditional-builds-stages-jobs/
@ericcornelissen

This comment has been minimized.

Copy link
Contributor Author

ericcornelissen commented Aug 27, 2018

Minor thing, but could we add a conditional branch = master to the deploy stage, so that PRs targetting develop don't run an empty stage?

Good idea, I added the conditional and it seems to work. I left the conditional in the deploy: as well just to be sure (this one), but I would be happy to remove it 馃槃

@birjolaxew

This comment has been minimized.

Copy link
Member

birjolaxew commented Aug 27, 2018

馃憤 Nice work on this!

@birjolaxew birjolaxew merged commit e414ade into simple-icons:develop Aug 27, 2018

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details

@ericcornelissen ericcornelissen deleted the ericcornelissen:tools/ci-stages branch Aug 27, 2018

@ericcornelissen

This comment has been minimized.

Copy link
Contributor Author

ericcornelissen commented Aug 30, 2018

I'm happy to report that the deployment still works, see this Travis build 馃帀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment