Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 27 additions & 20 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,22 +16,24 @@ jobs:
- name: Install Ruby and gems
uses: ruby/setup-ruby@v1
with:
ruby-version: 3.4.7
ruby-version: 3.4
bundler-cache: true

- name: Run Rubocop
run: bin/rubocop

test:
runs-on: ubuntu-latest
name: Ruby ${{ matrix.ruby }}
name: Ruby ${{ matrix.ruby }} (${{ matrix.appraisal }})
strategy:
matrix:
ruby:
- "3.1.7"
- "3.2.9"
- "3.3.10"
- "3.4.7"
ruby: ["3.1", "3.2", "3.3", "3.4"]
appraisal: ["rails_7.1", "rails_7.2", "rails_8.0", "rails_8.1"]
exclude:
- ruby: "3.1"
appraisal: "rails_8.0"
- ruby: "3.1"
appraisal: "rails_8.1"
services:
postgres:
image: postgres:17
Expand All @@ -49,21 +51,26 @@ jobs:
env:
RAILS_ENV: test
CI: true
# Use absolute path for BUNDLE_GEMFILE to avoid issues with relative path resolution
BUNDLE_GEMFILE: ${{ github.workspace }}/gemfiles/${{ matrix.appraisal }}.gemfile
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Checkout code
uses: actions/checkout@v4

- name: Install Ruby and gems
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
bundler-cache: true
- name: Install Ruby and gems
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
bundler-cache: true

- name: Set up Dummy
run: spec/dummy/bin/setup
- name: Set up Dummy
run: spec/dummy/bin/setup

- name: Run tests
run: bin/rspec
- name: Run tests
run: bin/rspec

- name: Run tests with customization
run: CHANGE_FIELD_BASE_CLASS=true CHANGE_VALUE_CLASS=true bin/rspec
- name: Run tests with customization
run: bin/rspec
env:
CHANGE_FIELD_BASE_CLASS: true
CHANGE_VALUE_CLASS: true
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,5 @@

.ruby-version
Gemfile.lock
gemfiles/*.lock
TODO.md
1 change: 1 addition & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ AllCops:
TargetRailsVersion: 8.1
NewCops: enable
Exclude:
- "gemfiles/*"
- "spec/dummy/db/schema.rb"

Layout/LineLength:
Expand Down
19 changes: 19 additions & 0 deletions Appraisals
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# frozen_string_literal: true

# See https://github.com/thoughtbot/appraisal for more information.

appraise "rails_7.1" do
gem "rails", "~> 7.1.0"
end

appraise "rails_7.2" do
gem "rails", "~> 7.2.0"
end

appraise "rails_8.0" do
gem "rails", "~> 8.0.0"
end

appraise "rails_8.1" do
gem "rails", "~> 8.1.0"
end
1 change: 1 addition & 0 deletions active_fields.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ Gem::Specification.new do |spec|
# Dependencies
spec.add_dependency "rails", ">= 7.1"

spec.add_development_dependency "appraisal"
spec.add_development_dependency "factory_bot"
spec.add_development_dependency "pg"
spec.add_development_dependency "rake"
Expand Down
15 changes: 15 additions & 0 deletions gemfiles/rails_7.1.gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# This file was generated by Appraisal

source "https://rubygems.org"

gem "puma"
gem "propshaft"
gem "importmap-rails"
gem "stimulus-rails"
gem "rails", "~> 7.1.0"

group :development do
gem "web-console"
end

gemspec path: "../"
15 changes: 15 additions & 0 deletions gemfiles/rails_7.2.gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# This file was generated by Appraisal

source "https://rubygems.org"

gem "puma"
gem "propshaft"
gem "importmap-rails"
gem "stimulus-rails"
gem "rails", "~> 7.2.0"

group :development do
gem "web-console"
end

gemspec path: "../"
15 changes: 15 additions & 0 deletions gemfiles/rails_8.0.gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# This file was generated by Appraisal

source "https://rubygems.org"

gem "puma"
gem "propshaft"
gem "importmap-rails"
gem "stimulus-rails"
gem "rails", "~> 8.0.0"

group :development do
gem "web-console"
end

gemspec path: "../"
15 changes: 15 additions & 0 deletions gemfiles/rails_8.1.gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# This file was generated by Appraisal

source "https://rubygems.org"

gem "puma"
gem "propshaft"
gem "importmap-rails"
gem "stimulus-rails"
gem "rails", "~> 8.1.0"

group :development do
gem "web-console"
end

gemspec path: "../"
13 changes: 6 additions & 7 deletions spec/dummy/bin/setup
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ FileUtils.chdir APP_ROOT do
# Add necessary setup steps to this file.

puts "== Installing dependencies =="
system! "gem install bundler --conservative"
system("bundle check") || system!("bundle install")

# puts "\n== Copying sample files =="
Expand All @@ -26,14 +25,14 @@ FileUtils.chdir APP_ROOT do

puts "\n== Preparing database =="
system! "bin/rails db:prepare"
system! "bin/rails db:reset" if ARGV.include?("--reset")

puts "\n== Removing old logs and tempfiles =="
system! "bin/rails log:clear tmp:clear"

puts "\n== Restarting application server =="
system! "bin/rails restart"

# puts "\n== Configuring puma-dev =="
# system "ln -nfs #{APP_ROOT} ~/.puma-dev/#{APP_NAME}"
# system "curl -Is https://#{APP_NAME}.test/up | head -n 1"
# unless ARGV.include?("--skip-server")
# puts "\n== Starting development server =="
# STDOUT.flush # flush the output before exec(2) so that it displays
# exec "bin/dev"
# end
end