Skip to content

Commit

Permalink
circleCI config update to add rubocop
Browse files Browse the repository at this point in the history
  • Loading branch information
smoline authored and solebared committed Apr 14, 2021
1 parent 5721819 commit 62ce3a0
Showing 1 changed file with 33 additions and 9 deletions.
42 changes: 33 additions & 9 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@ docker_image: &docker_image
version: 2.1
commands:
bundle_install:
description: "Performs the bundler installation, relying on the CircleCI cache for performance"
description: 'Performs the bundler installation, relying on the CircleCI cache for performance'
steps:
- restore_cache:
keys:
- bundler-cache-{{ checksum ".ruby-version" }}-{{ checksum "Gemfile.lock" }}
- run:
name: "Bundle Install"
name: 'Bundle Install'
command: |
set -euxo pipefail
bundle config set frozen 'true'
Expand All @@ -20,20 +20,35 @@ commands:
paths:
- .bundle
yarn_install:
description: "Performs node module installation, relying on the CircleCI cache for performance"
description: 'Performs node module installation, relying on the CircleCI cache for performance'
steps:
- restore_cache:
keys:
- node-cache-{{ checksum "package.json" }}-{{ checksum "yarn.lock" }}
- run:
name: "Yarn Modules Install"
name: 'Yarn Modules Install'
command: bin/yarn install
- save_cache:
key: node-cache-{{ checksum "package.json" }}-{{ checksum "yarn.lock" }}
paths:
- node_modules
rubocop:
description: 'Runs Rubocop'
steps:
- restore_cache:
keys:
- bundler-cache-{{ checksum ".ruby-version" }}-{{ checksum "Gemfile.lock" }}
- restore_cache:
keys:
- node-cache-{{ checksum "package.json" }}-{{ checksum "yarn.lock" }}
- run:
name: Rubocop
command: |
set -euxo pipefail
bundle config path .bundle
bundle exec rubocop
rspec_tests:
description: "Run the RSpec test suite"
description: 'Run the RSpec test suite'
steps:
- restore_cache:
keys:
Expand All @@ -42,20 +57,20 @@ commands:
keys:
- node-cache-{{ checksum "package.json" }}-{{ checksum "yarn.lock" }}
- run:
name: "Run the RSpec Test Suite"
name: 'Run the RSpec Test Suite'
command: |
set -euxo pipefail
bundle config path .bundle
bundle exec rails db:create
bundle exec rspec --format progress --format RspecJunitFormatter -o ~/rspec/rspec.xml
yarn_tests:
description: "Run the Mocha test suite"
description: 'Run the Mocha test suite'
steps:
- restore_cache:
keys:
- node-cache-{{ checksum "package.json" }}-{{ checksum "yarn.lock" }}
- run:
name: "Run the Mocha Test Suite"
name: 'Run the Mocha Test Suite'
command: yarn test --reporter mocha-junit-reporter
environment:
MOCHA_FILE: test/test-results.xml
Expand All @@ -73,6 +88,12 @@ jobs:
steps:
- checkout
- yarn_install
rubocop:
docker:
- <<: *docker_image
steps:
- checkout
- rubocop
ruby_tests:
docker:
- <<: *docker_image
Expand Down Expand Up @@ -106,11 +127,14 @@ workflows:
jobs:
- bundle
- node_modules
- rubocop:
requires:
- bundle
- node_modules
- ruby_tests:
requires:
- bundle
- node_modules
- js_tests:
requires:
- node_modules

0 comments on commit 62ce3a0

Please sign in to comment.