.circleci/config.yml
version: 2.1
orbs:
ruby: circleci/ruby@2.1.0
executors:
default:
docker:
- image: cimg/ruby:3.3.5
- image: cimg/postgres:16.0
environment:
POSTGRES_USER: circleci
POSTGRES_DB: dummy_test
POSTGRES_HOST_AUTH_METHOD: trust
environment:
CI: enabled
RAILS_ENV: test
RACK_ENV: test
PGHOST: localhost
jobs:
rspec:
executor: default
steps:
- checkout
- ruby/install-deps
- run: dockerize -wait tcp://localhost:5432 -timeout 2m
- run: bundle exec rake -f spec/dummy/Rakefile db:schema:load
- ruby/rspec-test
- run: |
curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-$CC_TEST_REPORTER_VERSION > ./cc-test-reporter
chmod +x ./cc-test-reporter
./cc-test-reporter format-coverage -t simplecov coverage/coverage.json
./cc-test-reporter upload-coverage
rubocop:
executor: default
steps:
- checkout
- ruby/install-deps
- ruby/rubocop-check
release:
executor: default
steps:
- checkout
- ruby/install-deps
- run: bundle exec rake release
yard:
executor: default
steps:
- checkout
- ruby/install-deps
- run: bundle exec yard doc
workflows:
version: 2.1
build:
jobs:
- rspec
- rubocop
- yard
- release:
filters:
branches:
ignore: /.*/
tags:
only: /^v\d+\.\d+\.\d+$/