You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

105 lines
2.5 KiB
Plaintext

version: 2.1
orbs:
browser-tools: circleci/browser-tools@1.2.2
node: circleci/node@4.7.0
ruby: circleci/ruby@1.1.4
executors:
ruby:
docker:
- image: cimg/ruby:<%= RUBY_VERSION %>-browsers
environment:
PGHOST: 127.0.0.1
PGUSER: postgres
PGPASS: postgres
RAILS_ENV: test
- image: circleci/postgres:13-ram
environment:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
commands:
install_node_dependencies:
steps:
- node/install:
install-yarn: true
install-npm: false
lts: true
- node/install-packages:
pkg-manager: yarn
set_up_database:
steps:
- run:
name: Set Up Database
command: bundle exec rake db:setup
jobs:
static_analysis:
executor: ruby
steps:
- checkout
- ruby/install-deps
- install_node_dependencies
- run:
name: Run Overcommit
command: |
gem install overcommit --no-document
git config --local user.name "Circle CI"
git config --local user.email ci@example.com
overcommit --sign
overcommit --run
security_audits:
executor: ruby
steps:
- checkout
- ruby/install-deps
- run:
name: Brakeman
command: bundle exec brakeman --exit-on-warn --no-progress --color --output /dev/stdout
- run:
name: Bundle Audit
command: bundle exec bundle-audit check --update -v
test:
executor: ruby
steps:
- checkout
- ruby/install-deps
- install_node_dependencies
- set_up_database
- run:
name: Run Tests
command: bundle exec rake test TESTOPTS="--ci-dir=./reports"
- store_test_results:
path: ./reports
test_system:
executor: ruby
steps:
- browser-tools/install-chrome
- checkout
- ruby/install-deps
- install_node_dependencies
- set_up_database
- run:
name: Run System Tests
command: |
bundle exec rake webdrivers:chromedriver:update
bundle exec rake test:system TESTOPTS="--ci-dir=./reports"
- store_test_results:
path: ./reports
- store_artifacts:
path: ./tmp/screenshots
destination: screenshots
workflows:
version: 2
commit-workflow:
jobs:
- static_analysis
- security_audits
- test
- test_system