|
1 | 1 | version: 2.1 # Use 2.1 to enable using orbs and other features. |
2 | 2 |
|
3 | 3 | # Declare the orbs that we'll use in our config. |
4 | | -# read more about orbs: https://circleci.com/docs/2.0/using-orbs/ |
5 | 4 | orbs: |
6 | 5 | |
7 | 6 |
|
8 | 7 | jobs: |
9 | | - build: # our first job, named "build" |
| 8 | + rubocop: |
| 9 | + parallelism: 1 |
10 | 10 | docker: |
11 | | - - image: cimg/ruby:2.7-node # use a tailored CircleCI docker image. |
| 11 | + - image: cimg/ruby:2.7-node |
12 | 12 | steps: |
13 | | - - checkout # pull down our git code. |
14 | | - - ruby/install-deps # use the ruby orb to install dependencies |
15 | | - |
16 | | - test: # our next job, called "test" |
17 | | - # we can run "parallel job containers" to enable speeding up our tests; |
18 | | - # this splits our tests across multiple containers. |
| 13 | + - checkout |
| 14 | + - ruby/install-deps |
| 15 | + - run: |
| 16 | + name: Run Rubocop |
| 17 | + command: bundle exec rubocop |
| 18 | + test: |
19 | 19 | parallelism: 1 |
20 | 20 | docker: |
21 | | - - image: cimg/ruby:2.7-node # this is our primary docker image, where step commands run. |
22 | | - # A series of steps to run, some are similar to those in "build". |
| 21 | + - image: cimg/ruby:2.7-node |
23 | 22 | steps: |
24 | 23 | - checkout |
25 | 24 | - ruby/install-deps |
26 | 25 | - run: |
27 | 26 | name: Run tests |
28 | 27 | command: bundle exec rspec -fd |
29 | 28 |
|
30 | | -# We use workflows to orchestrate the jobs that we declared above. |
31 | 29 | workflows: |
32 | 30 | version: 2 |
33 | | - build_and_test: # The name of our workflow is "build_and_test" |
34 | | - jobs: # The list of jobs we run as part of this workflow. |
35 | | - - build # Run build first. |
36 | | - - test: # Then run test, |
37 | | - requires: # Test requires that build passes for it to run. |
38 | | - - build # Finally, run the build job. |
| 31 | + checks: |
| 32 | + jobs: |
| 33 | + - rubocop |
| 34 | + - test |
0 commit comments