|
| 1 | +--- |
| 2 | +# --------------------------------------------------------------------------------------------------------------------- |
| 3 | +# CircleCI Snippets |
| 4 | +# |
| 5 | +# Reusable snippets are defined below this section. These are yaml fragments that can injected into the standard |
| 6 | +# CircleCI configuration, reducing the complexity of the entire block. |
| 7 | +# --------------------------------------------------------------------------------------------------------------------- |
| 8 | +docker_image: &docker_image |
| 9 | + image: 322902370520.dkr.ecr.us-east-1.amazonaws.com/customink/base-ruby-ci:2.1-v2.1 |
| 10 | + aws_auth: |
| 11 | + aws_access_key_id: ${STAGING_AWS_ACCESS_KEY_ID} |
| 12 | + aws_secret_access_key: ${STAGING_AWS_SECRET_ACCESS_KEY} |
| 13 | + |
| 14 | +# --------------------------------------------------------------------------------------------------------------------- |
| 15 | +# CircleCI Commands Configuration |
| 16 | +# |
| 17 | +# Commands are re-usable steps that can be shared across jobs. For example the installation of gems using bundler or |
| 18 | +# waiting on a database connection. By defining them inside the commands section, they can be invoked as any standard |
| 19 | +# command on the system, but will already be preconfigured. This allows us to keep the jobs definition small and clean |
| 20 | +# --------------------------------------------------------------------------------------------------------------------- |
| 21 | +version: 2.1 |
| 22 | +commands: |
| 23 | + bundle_install: |
| 24 | + description: "Performs the bundler installation, relying on the CircleCI cache for performance" |
| 25 | + steps: |
| 26 | + - restore_cache: |
| 27 | + keys: |
| 28 | + - bundler-cache-{{ checksum "vertex_client.gemspec" }} |
| 29 | + - run: |
| 30 | + name: "Bundle Install" |
| 31 | + command: bundle install --path=.bundle |
| 32 | + - save_cache: |
| 33 | + key: bundler-cache-{{ checksum "vertex_client.gemspec" }} |
| 34 | + paths: |
| 35 | + - .bundle |
| 36 | + rubocop: |
| 37 | + description: "Runs RuboCop with the correct configuration so the results can be parsed by CircleCI" |
| 38 | + steps: |
| 39 | + - run: |
| 40 | + name: "RuboCop" |
| 41 | + command: | |
| 42 | + bundle exec rubocop --format junit --out tmp/test-results/rubocop/results.xml |
| 43 | + minitest: |
| 44 | + description: "Runs Minitest with the correct configuration so it runs in parallel and is configured for CircleCI" |
| 45 | + steps: |
| 46 | + - run: |
| 47 | + name: "Minitest Test Suite" |
| 48 | + command: | |
| 49 | + cc-test-reporter before-build |
| 50 | + bin/test |
| 51 | + cc-test-reporter after-build |
| 52 | +# --------------------------------------------------------------------------------------------------------------------- |
| 53 | +# CircleCI Job Configuration |
| 54 | +# |
| 55 | +# This section defines all the available jobs that can be executed inside a Workflow. |
| 56 | +# Think of a Job as a batch of tasks that need to be performed to setup the environment and perform a specific task |
| 57 | +# such as running RSpec, uploading the test results to CodeClimate etc. |
| 58 | +# --------------------------------------------------------------------------------------------------------------------- |
| 59 | +jobs: |
| 60 | + tests: |
| 61 | + working_directory: ~/vertex_client |
| 62 | + docker: |
| 63 | + - <<: *docker_image |
| 64 | + environment: |
| 65 | + RAILS_ENV: test |
| 66 | + CC_TEST_REPORTER_ID: 88a7fd75659a6698f28c8c4c6b60c20f902e26733691b2fe449a65474f22b618 |
| 67 | + steps: |
| 68 | + - checkout |
| 69 | + - bundle_install |
| 70 | + - minitest |
| 71 | + - store_test_results: |
| 72 | + path: test/reports/ |
| 73 | +workflows: |
| 74 | + version: 2.1 |
| 75 | + vertex_client: |
| 76 | + jobs: |
| 77 | + - tests: |
| 78 | + context: customink |
0 commit comments