Skip to content

Commit

Permalink
Matrix to ensure ruby compatibility on CircleCI
Browse files Browse the repository at this point in the history
  • Loading branch information
ksylvest committed Feb 6, 2025
1 parent 31ffdba commit abbd660
Show file tree
Hide file tree
Showing 4 changed files with 154 additions and 116 deletions.
45 changes: 36 additions & 9 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,30 @@ version: 2.1
orbs:
ruby: circleci/[email protected]

commands:
codeclimate:
steps:
- run: |
curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-$CC_TEST_REPORTER_VERSION > ./cc
chmod +x ./cc
./cc format-coverage -t simplecov coverage/coverage.json
./cc upload-coverage
rm ./cc
executors:
default:
parameters:
ruby-version:
description: "ruby version tag"
default: "3.4.1"
type: string
postgres-version:
description: "postgres version tag"
default: "17.0"
type: string
docker:
- image: cimg/ruby:3.3.5
- image: cimg/postgres:16.0
- image: cimg/ruby:<<parameters.ruby-version>>
- image: cimg/postgres:<<parameters.postgres-version>>
environment:
POSTGRES_USER: circleci
POSTGRES_DB: dummy_test
Expand All @@ -19,18 +38,20 @@ executors:

jobs:
rspec:
executor: default
parameters:
ruby-version:
description: "ruby version tag"
type: string
executor:
name: default
ruby-version: <<parameters.ruby-version>>
steps:
- checkout
- ruby/install-deps
- run: dockerize -wait tcp://localhost:5432 -timeout 2m
- run: bundle exec rake -f spec/dummy/Rakefile db:schema:load
- ruby/rspec-test
- run: |
curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-$CC_TEST_REPORTER_VERSION > ./cc-test-reporter
chmod +x ./cc-test-reporter
./cc-test-reporter format-coverage -t simplecov coverage/coverage.json
./cc-test-reporter upload-coverage
- codeclimate
rubocop:
executor: default
steps:
Expand All @@ -54,7 +75,13 @@ workflows:
version: 2.1
build:
jobs:
- rspec
- rspec:
matrix:
parameters:
ruby-version:
- "3.4.1"
- "3.3.7"
- "3.2.6"
- rubocop
- yard
- release:
Expand Down
2 changes: 1 addition & 1 deletion .ruby-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.3.5
3.4.1
Loading

0 comments on commit abbd660

Please sign in to comment.