Skip to content

Commit

Permalink
Expand CI tests (#91)
Browse files Browse the repository at this point in the history
Test on Rails 7.2, 8.0 and main with most of our supported Ruby versions.

I couldn't get 7.0 to work with 3.0 though.
  • Loading branch information
kaspth authored Dec 18, 2024
1 parent 26e0882 commit 5623b8c
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 11 deletions.
24 changes: 18 additions & 6 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Ruby
name: CI

on:
push:
Expand All @@ -10,17 +10,29 @@ on:
jobs:
build:
runs-on: ubuntu-latest
name: Ruby ${{ matrix.ruby }}
env:
RAILS_ENV: test
strategy:
fail-fast: false
matrix:
rails:
- "8.0"
- "main"
ruby:
- '3.1'
- '3.3'
- "3.3"
- "3.4"
include:
- rails: "7.2"
ruby: "3.1"
env:
RAILS_ENV: test
RAILS_VERSION: ${{ matrix.rails }}

name: ${{ format('rails-{0} ruby-{1}', matrix.rails, matrix.ruby) }}

steps:
- uses: actions/checkout@v4

- run: rm Gemfile.lock

- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
Expand Down
12 changes: 10 additions & 2 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,16 @@ gem "rake", "~> 13.0"

gem "minitest", "~> 5.0"

gem "rails"
gem "activerecord"
rails_version = ENV.fetch("RAILS_VERSION", "8.0")

rails_constraint = if rails_version == "main"
{github: "rails/rails"}
else
"~> #{rails_version}.0"
end

gem "rails", rails_constraint

gem "sqlite3"
gem "sqlite-ulid", require: "sqlite_ulid"

Expand Down
3 changes: 1 addition & 2 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -193,11 +193,10 @@ PLATFORMS
x86_64-linux

DEPENDENCIES
activerecord
minitest (~> 5.0)
net-pop!
oaken!
rails
rails (~> 8.0.0)
rake (~> 13.0)
sqlite-ulid
sqlite3
Expand Down
2 changes: 1 addition & 1 deletion test/dummy/db/schema.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#
# It's strongly recommended that you check this file into your version control system.

ActiveRecord::Schema[8.0].define(version: 2024_06_30_172609) do
ActiveRecord::Schema[7.2].define(version: 2024_06_30_172609) do
create_table "accounts", id: :string, default: -> { "ULID()" }, force: :cascade do |t|
t.string "name"
t.datetime "created_at", null: false
Expand Down
2 changes: 2 additions & 0 deletions test/dummy/db/seeds.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
ActiveRecord::Base.logger = Logger.new(STDOUT) if ENV["VERBOSE"] || ENV["CI"]

Oaken.prepare do
defaults name: -> { "Shouldn't be used for users.name" }, title: -> { "Global Default Title" }

Expand Down

0 comments on commit 5623b8c

Please sign in to comment.