8000 Add rails 8 support by svanhesteren · Pull Request #19 · cheddar-me/gouda · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Add rails 8 support #19

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Mar 12, 2025
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
88 changes: 68 additions & 20 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,20 +1,38 @@
name: CI

on:
- push
pull_request:
push:
10000 branches: [ main ]

env:
BUNDLE_PATH: vendor/bundle

PGHOST: localhost
PGUSER: postgres
PGPASSWORD: postgres
TESTOPTS: "--fail-fast"

jobs:
test:
name: Tests
runs-on: ubuntu-22.04
if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository
strategy:
matrix:
ruby:
- '3.1'
lint:
name: "Lint"
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4

# Note: Appraisals for Rails 7 and Rails 8 differ in minimum Ruby version: 3.1.0+ vs 3.2.2+
# So the version of Ruby to use here is the version that is able to run all Appraisals
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: 3.2.2
bundler-cache: true

- name: Lint code for consistent style
run: bundle exec standardrb

test_rails7:
name: "Tests (Rails 7)"
runs-on: ubuntu-latest
services:
postgres:
image: postgres
Expand All @@ -23,19 +41,49 @@ jobs:
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
ports:
- 5432:5432

env:
BUNDLE_GEMFILE: ${{ github.workspace }}/gemfiles/rails_7.gemfile
steps:
- name: Checkout
- name: Install packages
run: sudo apt-get update && sudo apt-get install --no-install-recommends -y curl libjemalloc2

- name: Checkout code
uses: actions/checkout@v4
- name: Setup Ruby

- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
ruby-version: 3.2.2
bundler-cache: true
- name: "Tests and Lint"

- name: Run tests
run: bundle exec rake

test_rails_8:
name: "Tests (Rails 8)"
runs-on: ubuntu-latest
services:
postgres:
image: postgres
env:
PGHOST: localhost
PGUSER: postgres
PGPASSWORD: postgres
TESTOPTS: "--fail-fast"
POSTGRES_PASSWORD: postgres
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
ports:
- 5432:5432
env:
BUNDLE_GEMFILE: ${{ github.workspace }}/gemfiles/rails_8.gemfile
steps:
- name: Install packages
run: sudo apt-get update && sudo apt-get install --no-install-recommends -y curl libjemalloc2

- name: Checkout code
uses: actions/checkout@v4

- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: 3.2.2
bundler-cache: true

- name: Run tests
run: bundle exec rake
10 changes: 0 additions & 10 deletions .rubocop.yml

This file was deleted.

7 changes: 7 additions & 0 deletions Appraisals
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
appraise "rails-7" do
gem "rails", "< 8.0"
end

appraise "rails-8" do
gem "rails", ">= 8.0"
end
10 changes: 10 additions & 0 deletions gemfiles/rails_7.gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# This file was generated by Appraisal

source "https://rubygems.org"

gem "standard", require: false
gem "rake", "~> 13.0"
gem "minitest", "~> 5.0"
gem "rails", "< 8.0"

gemspec path: "../"
Loading
0