Leverage Heroku CI in buildpacks for zero-configuration CI
Description
Heroku CI augments standard buildpacks with a couple CI-specific steps (bin/test-compile and bin/test). They have about 6 languages supported currently and I'm sure it will take a while for third-party buildpacks to support these new steps, but if it takes off, it could be an easy way to get people started with CI without having to configure anything themselves. We already leverage buildpacks for auto deploy, how about leveraging it for zero-configuration CI?
Note, Heroku CI also augments app.json
with scripts.test-setup
and scripts.test
, and adds an environments:test
way to declare addons needed during tests. We don't currently listen to app.json
at all, but we could, if we wanted to have compatibility with Heroku CI for people who have gone beyond vanilla buildpack usage. app.json
has a lot of the same goals as our .gitlab-ci.yml
.
Proposal
-
Update
herokuish
with latest buildpacks -
Add test commands to
herokuish
(Note there already is atest
command, with a different purpose.)- Make sure handling of "no tests" is reasonable (probably should no-op succeed rather than error)
- Add test commands to our auto deploy image
-
Add test commands to Auto Deploy template - Add test commands to Auto DevOps template
Links / references
- Herokuish issue: https://github.com/gliderlabs/herokuish/issues/257
- Herokuish PR: https://github.com/gliderlabs/herokuish/pull/286
Test projects
So far successfully tested on next projects:
- Clojure, no db -> https://gitlab.com/dzaporozhets/clj-hello-world
- Rails, Postgres -> https://gitlab.com/dzaporozhets/rails-hello-world
- Nodejs, Express -> https://gitlab.com/dzaporozhets/express-hello-world
- Java, Spring -> https://gitlab.com/dzaporozhets/spring-hello-world
- Scale, Play -> https://gitlab.com/dzaporozhets/play-hello-world
Build fails
- Python, django -> https://gitlab.com/dzaporozhets/django-hello-world. Buildpack does not support
test
command - Ruby, no tests -> https://gitlab.com/dzaporozhets/sample-ruby-app/-/jobs/30607321