From 18653dca254f06f671516fc0a862f27a3166faf7 Mon Sep 17 00:00:00 2001 From: Nic Duke Date: Tue, 1 Oct 2024 11:10:21 +1300 Subject: [PATCH] Revert circleci config change --- .circleci/config.yml | 53 ++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 51 insertions(+), 2 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 6e6eb92..4d9f3f0 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -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 @@ -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: @@ -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: @@ -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 @@ -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