RefugeRestrooms / refugerestrooms

REFUGE restrooms indexes and maps safe restroom locations for trans, intersex, and gender nonconforming individuals.
http://www.refugerestrooms.org
GNU Affero General Public License v3.0
894 stars 261 forks source link

Optimize Travis CI build speed #515

Closed DeeDeeG closed 5 years ago

DeeDeeG commented 6 years ago

Commit message:

Moves docker-compose build from the before_install: step to the install: step in Travis CI.

This overrides the default install: step for Ruby apps, which is bundle install --jobs=3 --retry=3.

In doing so, we avoid running bundle install twice:

  • Once inside the Docker container (good)
  • Again outside of the container (unnecessary)

(The bundle install outside of the Docker container would have no bearing on our web app, tests, etc... but it would make Travis CI take longer to build the branch.)

See: https://docs.travis-ci.com/user/customizing-the-build/#the-build-lifecycle https://docs.travis-ci.com/user/customizing-the-build/#customizing-the-installation-step https://docs.travis-ci.com/user/customizing-the-build/#breaking-the-build

https://docs.travis-ci.com/user/languages/ruby#dependency-management

Context

Summary of Changes

Checklist

Screenshots

Before

before-travis

After

after-travis

DeeDeeG commented 6 years ago

This PR's commits are edited a bit since I first posted it.

I found out my original commit for this PR didn't effectively do anything, since Travis apparently noticed our Gemfile and Gemfile.lock and automatically determined we were running a Ruby app. sets the language to "ruby" by default if you leave the language: field blank.

This second commit is the one we actually need to shorten runs.

The old branch with both commits is here for now: https://github.com/DeeDeeG/refugerestrooms/tree/optimize-Travis-config-old

DeeDeeG commented 5 years ago

This works as expected. It's nice to have faster Travis builds, so merging.