Skip to content

Commit

Permalink
Merge branch 'main' into avoid-orphans
Browse files Browse the repository at this point in the history
  • Loading branch information
ledermann authored Nov 9, 2024
2 parents c6964f0 + f935285 commit 58f1a68
Show file tree
Hide file tree
Showing 21 changed files with 268 additions and 116 deletions.
135 changes: 94 additions & 41 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,74 +10,127 @@ jobs:
strategy:
fail-fast: false
matrix:
ruby: [2.3, 2.4, 2.5, 2.6, 2.7, 3.0, 3.1, 3.2]
ruby: ["2.3", "2.4", "2.5", "2.6", "2.7", "3.0", "3.1", "3.2", "3.3"]
appraisal:
- rails52
- rails60
- rails61
- rails70
- rails71
- rails72
- rails80
- rails_main
db: [POSTGRES, MYSQL, SQLITE]
exclude:
# MySQL has issues on Ruby 2.3
# https://github.com/ruby/setup-ruby/issues/150
- ruby: 2.3
- ruby: "2.3"
db: MYSQL

# PostgreSQL is segfaulting on 2.3
# Doesn't seem worth solving.
- ruby: 2.3
- ruby: "2.3"
db: POSTGRES

# Rails 5.2 supports Ruby 2.2-2.5
- appraisal: rails52
ruby: 2.6
ruby: "2.6"
- appraisal: rails52
ruby: 2.7
ruby: "2.7"
- appraisal: rails52
ruby: 3.0
ruby: "3.0"
- appraisal: rails52
ruby: 3.1
ruby: "3.1"
- appraisal: rails52
ruby: 3.2
ruby: "3.2"
- appraisal: rails52
ruby: "3.3"

# Rails 6.0 supports Ruby 2.5-2.7
- appraisal: rails60
ruby: 2.3
ruby: "2.3"
- appraisal: rails60
ruby: "2.4"
- appraisal: rails60
ruby: 2.4
ruby: "3.0"
- appraisal: rails60
ruby: 3.0
ruby: "3.1"
- appraisal: rails60
ruby: 3.1
ruby: "3.2"
- appraisal: rails60
ruby: 3.2
ruby: "3.3"

# Rails 6.1 supports Ruby 2.5+
- appraisal: rails61
ruby: 2.3
ruby: "2.3"
- appraisal: rails61
ruby: 2.4
ruby: "2.4"

# Rails 7 supports Ruby 2.7+
- appraisal: rails70
ruby: 2.3
ruby: "2.3"
- appraisal: rails70
ruby: 2.4
ruby: "2.4"
- appraisal: rails70
ruby: 2.5
ruby: "2.5"
- appraisal: rails70
ruby: 2.6
ruby: "2.6"

# Rails 7.1 supports Ruby 2.7+
- appraisal: rails71
ruby: 2.3
ruby: "2.3"
- appraisal: rails71
ruby: 2.4
ruby: "2.4"
- appraisal: rails71
ruby: 2.5
ruby: "2.5"
- appraisal: rails71
ruby: 2.6
ruby: "2.6"

# Rails 7.2 supports Ruby 3.1+
- appraisal: rails72
ruby: "2.3"
- appraisal: rails72
ruby: "2.4"
- appraisal: rails72
ruby: "2.5"
- appraisal: rails72
ruby: "2.6"
- appraisal: rails72
ruby: "2.7"
- appraisal: rails72
ruby: "3.0"

# Rails 8.0 supports Ruby 3.2+
- appraisal: rails80
ruby: "2.3"
- appraisal: rails80
ruby: "2.4"
- appraisal: rails80
ruby: "2.5"
- appraisal: rails80
ruby: "2.6"
- appraisal: rails80
ruby: "2.7"
- appraisal: rails80
ruby: "3.0"
- appraisal: rails80
ruby: "3.1"

# Rails main supports Ruby 3.2+
- appraisal: rails_main
ruby: "2.3"
- appraisal: rails_main
ruby: "2.4"
- appraisal: rails_main
ruby: "2.5"
- appraisal: rails_main
ruby: "2.6"
- appraisal: rails_main
ruby: "2.7"
- appraisal: rails_main
ruby: "3.0"
- appraisal: rails_main
ruby: "3.1"

services:
postgres:
Expand All @@ -94,24 +147,24 @@ jobs:
env:
DB_DATABASE: audited_test
DB_USER: root
DB_PASSWORD: 'root'
DB_PASSWORD: "root"
DB_HOST: localhost

steps:
- name: Setup MySQL
run: |
sudo /etc/init.d/mysql start
mysql -e 'CREATE DATABASE audited_test;' -uroot -proot
mysql -e 'SHOW DATABASES;' -uroot -proot
- uses: actions/checkout@v3
- name: Copy Gemfile
run: sed 's/\.\././' gemfiles/${{ matrix.appraisal }}.gemfile > Gemfile
- name: Set up Ruby ${{ matrix.ruby }}
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
bundler-cache: true
- name: Run tests
env:
DB: ${{ matrix.db }}
run: bundle exec rake
- name: Setup MySQL
run: |
sudo /etc/init.d/mysql start
mysql -e 'CREATE DATABASE audited_test;' -uroot -proot
mysql -e 'SHOW DATABASES;' -uroot -proot
- uses: actions/checkout@v4
- name: Copy Gemfile
run: sed 's/\.\././' gemfiles/${{ matrix.appraisal }}.gemfile > Gemfile
- name: Set up Ruby ${{ matrix.ruby }}
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
bundler-cache: true
- name: Run tests
env:
DB: ${{ matrix.db }}
run: bundle exec rake
51 changes: 27 additions & 24 deletions Appraisals
Original file line number Diff line number Diff line change
@@ -1,26 +1,8 @@
# Include DB adapters matching the version requirements in
# rails/activerecord/lib/active_record/connection_adapters/*adapter.rb

appraise "rails50" do
gem "rails", "~> 5.0.0"
gem "mysql2", ">= 0.3.18", "< 0.6.0"
gem "pg", ">= 0.18", "< 2.0"
gem "sqlite3", "~> 1.3.6"
gem "psych", "~> 3.1"
gem "loofah", "2.20.0"
end

appraise "rails51" do
gem "rails", "~> 5.1.4"
gem "mysql2", ">= 0.3.18", "< 0.6.0"
gem "pg", ">= 0.18", "< 2.0"
gem "sqlite3", "~> 1.3.6"
gem "psych", "~> 3.1"
gem "loofah", "2.20.0"
end

appraise "rails52" do
gem "rails", ">= 5.2.8.1", "< 5.3"
gem "rails", "~> 5.2.8"
gem "mysql2", ">= 0.4.4", "< 0.6.0"
gem "pg", ">= 0.18", "< 2.0"
gem "sqlite3", "~> 1.3.6"
Expand All @@ -29,29 +11,50 @@ appraise "rails52" do
end

appraise "rails60" do
gem "rails", ">= 6.0.0", "< 6.1"
gem "rails", "~> 6.0.6"
gem "mysql2", ">= 0.4.4"
gem "pg", ">= 0.18", "< 2.0"
gem "sqlite3", "~> 1.4"
end

appraise "rails61" do
gem "rails", ">= 6.1.0", "< 6.2"
gem "rails", "~> 6.1.7"
gem "mysql2", ">= 0.4.4"
gem "pg", ">= 1.1", "< 2.0"
gem "sqlite3", "~> 1.4"
end

appraise "rails70" do
gem "rails", ">= 7.0.0", "< 7.1"
gem "rails", "~> 7.0.8"
gem "mysql2", ">= 0.4.4"
gem "pg", ">= 1.1"
gem "sqlite3", ">= 1.4"
gem "sqlite3", "~> 1.4"
end

appraise "rails71" do
gem "rails", ">= 7.1.0.beta1", "< 7.2"
gem "rails", "~> 7.1.3"
gem "mysql2", ">= 0.4.4"
gem "pg", ">= 1.1"
gem "sqlite3", "~> 1.4"
end

appraise "rails72" do
gem "rails", "~> 7.2.0"
gem "mysql2", "~> 0.5"
gem "pg", "~> 1.1"
gem "sqlite3", ">= 1.4"
end

appraise "rails80" do
gem "rails", "~> 8.0.0"
gem "mysql2", "~> 0.5"
gem "pg", "~> 1.1"
gem "sqlite3", ">= 1.4"
end

appraise "rails_main" do
gem "rails", github: "rails/rails", branch: "main"
gem "mysql2", "~> 0.5"
gem "pg", "~> 1.1"
gem "sqlite3", ">= 2.0"
end
18 changes: 17 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,21 @@
# Audited ChangeLog

### 5.8.0 (2024-11-08)
- Allow calling audited multiple times - @mohammednasser-32
[734](https://github.com/collectiveidea/audited/pull/734)
- Relax gemspec to allow Rails 8.1 - @BranLiang
[738](https://github.com/collectiveidea/audited/pull/738)

### 5.7.0 (2024-08-13)

- Support for Rails 7.2 and Ruby 3.3, and testing cleanups - @mattbrictson
[#723](https://github.com/collectiveidea/audited/pull/723)
- Allow max_audits to be a proc or symbol - @gmhawash
[#718](https://github.com/collectiveidea/audited/pull/718)
- Support Rails 8 - @fernandomenolli
[#717](https://github.com/collectiveidea/audited/pull/717)


### 5.6.0 (2024-04-05)

- Removed support for Rails 5.0 and 5.1.
Expand Down Expand Up @@ -38,7 +54,7 @@
## 5.3.3 (2023-03-24)

- Use RequestStore instead of Thread.current for thread-safe requests - @tiagocassio
[#669](https://github.com/collectiveidea/audited/pull/669)
[#669](https://github.com/c ollectiveidea/audited/pull/669)
- Clean up Touch audits - @mcyoung, @akostadinov
[#668](https://github.com/collectiveidea/audited/pull/668)

Expand Down
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Audited
**Audited** (previously acts_as_audited) is an ORM extension that logs all changes to your models. Audited can also record who made those changes, save comments and associate models related to the changes.


Audited currently (5.6) works with Rails 7.1, 7.0, 6.1, 6.0, 5.2.
Audited currently (5.6) works with Rails 7.2, 7.1, 7.0, 6.1, 6.0, 5.2.

For Rails 5.0 & 5.1, use gem version 5.4.3
For Rails 4, use gem version 4.x
Expand All @@ -26,6 +26,7 @@ Audited supports and is [tested against](https://github.com/collectiveidea/audit
* 3.0
* 3.1
* 3.2
* 3.3

Audited may work just fine with a Ruby version not listed above, but we can't guarantee that it will. If you'd like to maintain a Ruby that isn't listed, please let us know with a [pull request](https://github.com/collectiveidea/audited/pulls).

Expand Down
6 changes: 3 additions & 3 deletions audited.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@ Gem::Specification.new do |gem|

gem.required_ruby_version = ">= 2.3.0"

gem.add_dependency "activerecord", ">= 5.2", "< 7.2"
gem.add_dependency "activesupport", ">= 5.2", "< 7.2"
gem.add_dependency "activerecord", ">= 5.2", "< 8.2"
gem.add_dependency "activesupport", ">= 5.2", "< 8.2"

gem.add_development_dependency "appraisal"
gem.add_development_dependency "rails", ">= 5.2", "< 7.2"
gem.add_development_dependency "rails", ">= 5.2", "< 8.2"
gem.add_development_dependency "rspec-rails"
gem.add_development_dependency "standard"
gem.add_development_dependency "single_cov"
Expand Down
12 changes: 0 additions & 12 deletions gemfiles/rails50.gemfile

This file was deleted.

12 changes: 0 additions & 12 deletions gemfiles/rails51.gemfile

This file was deleted.

2 changes: 1 addition & 1 deletion gemfiles/rails52.gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

source "https://rubygems.org"

gem "rails", ">= 5.2.8.1", "< 5.3"
gem "rails", "~> 5.2.8"
gem "mysql2", ">= 0.4.4", "< 0.6.0"
gem "pg", ">= 0.18", "< 2.0"
gem "sqlite3", "~> 1.3.6"
Expand Down
2 changes: 1 addition & 1 deletion gemfiles/rails60.gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

source "https://rubygems.org"

gem "rails", ">= 6.0.0", "< 6.1"
gem "rails", "~> 6.0.6"
gem "mysql2", ">= 0.4.4"
gem "pg", ">= 0.18", "< 2.0"
gem "sqlite3", "~> 1.4"
Expand Down
2 changes: 1 addition & 1 deletion gemfiles/rails61.gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

source "https://rubygems.org"

gem "rails", ">= 6.1.0", "< 6.2"
gem "rails", "~> 6.1.7"
gem "mysql2", ">= 0.4.4"
gem "pg", ">= 1.1", "< 2.0"
gem "sqlite3", "~> 1.4"
Expand Down
Loading

0 comments on commit 58f1a68

Please sign in to comment.