CI for Ruby
Build, lint, and test a Ruby application using Bundler, RuboCop, and RSpec.
Use template →env:
BUNDLE_PATH: vendor/bundle
steps:
- label: ":ruby: Install gems"
command: "bundle install"
key: "gems"
plugins:
- docker#v5.9.0:
image: "ruby:3.3"
environment:
- BUNDLE_PATH
- artifacts#v1.9.3:
upload: "$BUNDLE_PATH"
compressed: $BUNDLE_PATH.tgz
- label: ":rubocop: Run rubocop"
command: "bundle exec rubocop"
depends_on: "gems"
plugins:
- docker#v5.9.0:
image: "ruby:3.3"
environment:
- BUNDLE_PATH
- artifacts#v1.9.3:
download: "$BUNDLE_PATH"
compressed: $BUNDLE_PATH.tgz
- label: ":rspec: Run rspec"
command: "bundle exec rspec"
depends_on: "gems"
plugins:
- docker#v5.9.0:
image: "ruby:3.3"
environment:
- BUNDLE_PATH
- artifacts#v1.9.3:
download: "$BUNDLE_PATH"
compressed: $BUNDLE_PATH.tgz
- Languages
- Ruby
- Use cases
- Continuous integration, Web application
- Platforms
- Docker
CI for Ruby
Build, lint, and test a Ruby application using Bundler, RuboCop, and RSpec.
Use template →CI for Ruby
This template gives you a continuous integration (CI) pipeline that builds, lints, and tests a Ruby application.
At a glance:
How it works
This template:
- Installs ruby gems using bundler, caching the result.
- Lints your Ruby code with RuboCop.
- Runs tests with RSpec.
All steps run in serial, with each depending on the previous step to complete before starting. The runtime environment uses a Docker image with the latest version of Ruby.
Next steps
After you select Use template, you’ll:
- Connect the Git repository with your Ruby application.
- Modify the commands if necessary.
- Configure the compute—run locally, on-premises, or in the cloud.
- Run the pipeline.
You can then play around with the pipeline settings. For example, run the pipeline locally while you iterate on the definition or set a schedule to trigger a nightly build.
If you need help, please check our documentation, raise an issue , or reach out to support.