From 5b0b04256e550afca3d9d04f513a01666f64884f Mon Sep 17 00:00:00 2001 From: LucDelmon <35261367+LucDelmon@users.noreply.github.com> Date: Thu, 15 Sep 2022 17:28:28 +0200 Subject: [PATCH] feat: add .circleci/config.yml --- .circleci/config.yml | 64 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 64 insertions(+) create mode 100644 .circleci/config.yml diff --git a/.circleci/config.yml b/.circleci/config.yml new file mode 100644 index 0000000..9a06359 --- /dev/null +++ b/.circleci/config.yml @@ -0,0 +1,64 @@ +version: 2.1 + +orbs: + ruby: circleci/ruby@1.8.0 + +executors: + ruby: + docker: + - image: cimg/ruby:3.0.0 + environment: + RAILS_ENV: test + ruby_and_postgres: + docker: + - image: cimg/ruby:3.0.0 + environment: + RAILS_ENV: test + DATABASE_HOST: localhost + - image: cimg/postgres:14.4 + environment: + POSTGRES_USER: postgres + POSTGRES_HOST_AUTH_METHOD: trust + +jobs: + build: + executor: ruby + steps: + - checkout + - ruby/install-deps: + key: gems-{{ checksum "Gemfile.lock" }} + - persist_to_workspace: + root: . + paths: . + tests: + parallelism: 4 + executor: ruby_and_postgres + steps: + - attach_workspace: + at: . + - run: bundle exec rails db:setup + - ruby/rspec-test + static_analysis: + parallelism: 4 + executor: ruby + steps: + - attach_workspace: + at: . + - ruby/rubocop-check: + parallel: true + - run: bundle exec brakeman -z + - run: gem install bundle-audit + - run: bundle-audit update + - run: bundle-audit + +workflows: + version: 2 + ci_workflow: + jobs: + - build + - tests: + requires: + - build + - static_analysis: + requires: + - build