dawarich/.circleci/config.yml

64 lines
1.8 KiB
YAML
Raw Permalink Normal View History

2024-08-20 16:14:29 -04:00
version: 2.1
orbs:
2024-09-05 15:23:24 -04:00
ruby: circleci/ruby@2.1.4
browser-tools: circleci/browser-tools@1.4.8
2025-02-02 15:41:41 -05:00
2024-08-20 16:14:29 -04:00
jobs:
test:
2024-08-20 16:14:29 -04:00
docker:
2025-09-26 13:01:21 -04:00
- image: cimg/ruby:3.4.6-browsers
environment:
RAILS_ENV: test
2025-05-26 16:18:20 -04:00
CI: true
2025-06-08 07:01:26 -04:00
DATABASE_HOST: localhost
2025-06-08 06:54:19 -04:00
DATABASE_NAME: dawarich_test
DATABASE_USERNAME: postgres
DATABASE_PASSWORD: mysecretpassword
2025-06-08 07:01:26 -04:00
DATABASE_PORT: 5432
2025-01-29 05:57:53 -05:00
- image: cimg/postgres:13.3-postgis
environment:
POSTGRES_USER: postgres
2025-06-08 06:54:19 -04:00
POSTGRES_DB: dawarich_test
POSTGRES_PASSWORD: mysecretpassword
2025-06-09 07:39:25 -04:00
- image: redis:7.0
2025-05-26 16:18:20 -04:00
- image: selenium/standalone-chrome:latest
name: chrome
2025-05-29 06:05:50 -04:00
environment:
START_XVFB: 'false'
JAVA_OPTS: -Dwebdriver.chrome.whitelistedIps=
2025-02-03 14:00:50 -05:00
2024-08-20 16:14:29 -04:00
steps:
- checkout
2025-05-26 16:18:20 -04:00
- browser-tools/install-chrome
- browser-tools/install-chromedriver
2024-08-20 16:14:29 -04:00
- run:
name: Install Bundler
command: gem install bundler
- run:
name: Bundle Install
command: bundle install --jobs=4 --retry=3
2025-05-29 06:05:50 -04:00
- run:
name: Wait for Selenium Chrome
command: |
dockerize -wait tcp://chrome:4444 -timeout 1m
- run:
name: Database Setup
command: |
2025-06-08 06:54:19 -04:00
bundle exec rails db:create RAILS_ENV=test
bundle exec rails db:schema:load RAILS_ENV=test
# Create the queue database manually if it doesn't exist
PGPASSWORD=mysecretpassword createdb -h localhost -U postgres dawarich_test_queue || true
- run:
name: Run RSpec tests
command: bundle exec rspec
2024-08-20 16:44:09 -04:00
- store_artifacts:
path: coverage
2025-05-29 06:05:50 -04:00
- store_artifacts:
path: tmp/capybara
2025-02-02 15:51:32 -05:00
2024-08-20 16:14:29 -04:00
workflows:
2025-02-03 14:00:50 -05:00
rspec:
2025-02-02 15:41:41 -05:00
jobs:
2025-02-02 15:49:52 -05:00
- test