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.
101 lines
2.4 KiB
Plaintext
101 lines
2.4 KiB
Plaintext
version: 2.1
|
|
|
|
orbs:
|
|
browser-tools: circleci/browser-tools@1.2.5
|
|
node: circleci/node@5.0.2
|
|
ruby: circleci/ruby@1.6.0
|
|
|
|
executors:
|
|
ruby:
|
|
docker:
|
|
- image: cimg/ruby:<%= RUBY_VERSION %>-browsers
|
|
environment:
|
|
PGHOST: 127.0.0.1
|
|
PGUSER: postgres
|
|
PGPASS: postgres
|
|
RAILS_ENV: test
|
|
- image: cimg/postgres:14.2
|
|
environment:
|
|
POSTGRES_USER: postgres
|
|
POSTGRES_PASSWORD: postgres
|
|
|
|
commands:
|
|
install_node_dependencies:
|
|
steps:
|
|
- node/install:
|
|
install-yarn: true
|
|
- node/install-packages:
|
|
pkg-manager: yarn
|
|
set_up_database:
|
|
steps:
|
|
- run:
|
|
name: Set Up Database
|
|
command: bundle exec rake db:create db:schema:load
|
|
|
|
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
|
|
- 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
|
|
- browser-tools/install-chromedriver
|
|
- checkout
|
|
- ruby/install-deps
|
|
- install_node_dependencies
|
|
- set_up_database
|
|
- run:
|
|
name: Run System Tests
|
|
command: 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
|