Skip to content

Commit

Permalink
Revert circleci config change
Browse files Browse the repository at this point in the history
  • Loading branch information
duknic committed Sep 30, 2024
1 parent e79f8cd commit 18653dc
Showing 1 changed file with 51 additions and 2 deletions.
53 changes: 51 additions & 2 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,22 @@ version: 2.1

# executors are environments in which a job runs. Here we use docker contaners.
executors:
ruby-2-6:
docker:
- image: circleci/ruby:2.6.6-node-browsers
- image: circleci/postgres:10.6
environment:
- POSTGRES_USER=draft_approve_test
- POSTGRES_DB=draft_approve_test

ruby-2-7:
docker:
- image: circleci/ruby:2.7.2-node-browsers
- image: circleci/postgres:10.6
environment:
- POSTGRES_USER=draft_approve_test
- POSTGRES_DB=draft_approve_test

ruby-3-0:
docker:
- image: circleci/ruby:3.0.0-node-browsers
Expand All @@ -17,12 +33,18 @@ jobs:
# We can use YAML to define a part of a job we alias as 'build', and then include it in other jobs to keep things DRY
build-default: &build
parameters:
run-activerecord-5-2-x:
type: boolean
default: true
run-activerecord-6-0-x:
type: boolean
default: true
run-activerecord-6-1-x:
type: boolean
default: true

# Specify a default executor for the job
executor: ruby-3-0
executor: ruby-2-6
working_directory: ~/repo

steps:
Expand Down Expand Up @@ -62,6 +84,20 @@ jobs:
mkdir /tmp/test-results
TEST_FILES="$(circleci tests glob "spec/**/*_spec.rb" | circleci tests split --split-by=timings)"
- when:
condition: << parameters.run-activerecord-5-2-x >>
steps:
- run:
name: run activerecord-5.2.x tests
command: bundle exec appraisal activerecord-5-2-x rspec

- when:
condition: << parameters.run-activerecord-6-0-x >>
steps:
- run:
name: run activerecord-6.0.x tests
command: bundle exec appraisal activerecord-6-0-x rspec

- when:
condition: << parameters.run-activerecord-6-1-x >>
steps:
Expand All @@ -76,6 +112,15 @@ jobs:
path: /tmp/test-results
destination: test-results

# Specific build jobs for each ruby version
build-ruby-2-6:
<<: *build
executor: ruby-2-6

build-ruby-2-7:
<<: *build
executor: ruby-2-7

build-ruby-3-0:
<<: *build
executor: ruby-3-0
Expand All @@ -84,4 +129,8 @@ jobs:
workflows:
build_all_versions:
jobs:
- build-ruby-3-0
- build-ruby-2-6
- build-ruby-2-7
- build-ruby-3-0:
# Rails/ActiveRecord earlier than 6.x is not compatible with ruby 3
run-activerecord-5-2-x: false

0 comments on commit 18653dc

Please sign in to comment.