CI for Ruby
Build, lint, and test a Ruby application using Bundler, RuboCop, and RSpec.
Use template →1env:
2 BUNDLE_PATH: vendor/bundle
3
4steps:
5 - label: ":ruby: Install gems"
6 command: "bundle install"
7 key: "gems"
8 plugins:
9 - docker#v5.9.0:
10 image: "ruby:3.3"
11 environment:
12 - BUNDLE_PATH
13 - artifacts#v1.9.3:
14 upload: "$BUNDLE_PATH"
15 compressed: $BUNDLE_PATH.tgz
16
17 - label: ":rubocop: Run rubocop"
18 command: "bundle exec rubocop"
19 depends_on: "gems"
20 plugins:
21 - docker#v5.9.0:
22 image: "ruby:3.3"
23 environment:
24 - BUNDLE_PATH
25 - artifacts#v1.9.3:
26 download: "$BUNDLE_PATH"
27 compressed: $BUNDLE_PATH.tgz
28
29 - label: ":rspec: Run rspec"
30 command: "bundle exec rspec"
31 depends_on: "gems"
32 plugins:
33 - docker#v5.9.0:
34 image: "ruby:3.3"
35 environment:
36 - BUNDLE_PATH
37 - artifacts#v1.9.3:
38 download: "$BUNDLE_PATH"
39 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.