-
-
Notifications
You must be signed in to change notification settings - Fork 20
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
Speed up CI pipeline #1060
Speed up CI pipeline #1060
Conversation
runs-on: ubuntu-latest | ||
needs: [build] |
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.
note: needs:
makes test
job only execute if build
job is successful.
- name: Start Rails server | ||
run: | | ||
export PATH=$PATH:~/bin | ||
bin/run & |
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.
note: build
job currently has the same steps that test
job does. but this is a WIP and I'll see if I can make setup a reusable step to DRY it up. Since we aren't using docker-compose to build the full stack i dunno it it's possible to build the app once and then share it between the different jobs. each job runs on its own VM so I think it's like each job is running on a fresh machine.
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.
It looks like you're already setting up caching, which should make downstream containers "speedrun" the bundle/yarn/brew processes!
So the most likely vector of decomposition would be to gather the duplicative bits into a job or pulling out a workflow but I'm not really fluent enough in Github Action's domain specific language to know which pathway is most likely to be shortest-to-successful.
# To wait for asset built | ||
# TODO: Start server in production mode | ||
curl --connect-timeout 5 --retry 5 --retry-delay 5 --retry-max-time 40 --retry-connrefused localhost:3000 1> /dev/null | ||
bin/test |
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.
Currently, all tests are running via bin/test
script.
In order to decompose the test job into separate jobs test-features
and test-rspec
that will run in parallel, the pipe is gonna need a different command to execute tests.
I think these are the appropriate commands:
- Run
test-rspec
-bundle exec rspec
- Run
test-features
-yarn run test
(which invokes package.json script test)
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.
You could also split the bin/test
script into bin/test-features
and bin/test-rspec
and then call those directly!
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.
maybe. But we use bin/test
script for local test runs to conveniently run all the tests. If I split bin/test
out into 2 new scripts, and we want to preserve the ability to easily run all tests that I'd have to... 🤔 make bin/test
invoke bin/test-features
and bin/test-rspec
. Could it be an abstraction overkill?
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.
I think it's one of those tradeoffs where neither are advantageous over the other. Using bin/rspec
or bin/rake
for ruby and yarn run test
for cucumber are totally fine.
This is looking really good! It looks like the biggest time-savings will be removing homebrew from the CI pipeline; as that is adding 1.5m just to get homebrew installed, and another 4~5m to install the dependencies. |
I think we need brew for overmind and other dependencies. |
What if we... didn't use overmind or other brew-based installation bits in CI? |
I'm blocked on this. Waiting on a dev ops friend to advise me. |
RSpec in < 1m! This is the happiest I've ever been! |
03514fb
to
38f882c
Compare
4m!!! That's soooo fast! |
One thing I'm wondering about is that initial "install and cache dependencies" step: it does a bundle install and a yarn install, and that's it. The two test steps also have to then do bundle install and yarn install, and I don't know if the caches are shared between the different steps. It might be better to just remove the separate "install" step, and just run the two different test sets in parallel. Thoughts? |
🤔 What happens if we leave the "bundle install and a yarn install" steps in the setup job and remove them from the 2 parallel test jobs? 🗒️ According to GHA cache doc caching seems to be shared between jobs.
|
5d6cb8e
to
6bfc432
Compare
I removed the |
So, is this ready to merge then?! It looks amazing! I want it!!! |
c205660
to
6e9d630
Compare
6e9d630
to
b0bfde4
Compare
@zspencer i think this is good enough to merge (if we want to do more tightening, we can always do that in follow-up PRs) |
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.
YESSSSS
Thanks so much for taking this over the finish line @anaulin 🏁 🏎️ I ran outta steam at the end and this past week has been packed with family projects. Thanks again! 🙇♀️ |
This is the happiest I have ever been! |
A continuation of #1053
Problem:
The CI pipeline currently runs as 1 job that executes everything sequentially:
Fix:
Break up the pipeline so after the app is built, unit, and feature tests run in parallel.
--> run browser tests
TODO:
bin/setup
stuff out and replace them with github-actions specific prep!)build
- (can start rails app)test-rspec
- (enviro + run unit tests)test-features
- (browser enviro + run browser tests)build
job is successfulWarning: The `set-output` command is deprecated and will be disabled soon. Please upgrade to using Environment Files. For more information see: https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/
extract repeated "services" sections into shared YAML block (see https://joshdevlin.com/blog/yaml-repeating-sections/)not supported by GitHub workflows