diff --git a/.circleci/config.yml b/.circleci/config.yml deleted file mode 100644 index 7ed1e93..0000000 --- a/.circleci/config.yml +++ /dev/null @@ -1,55 +0,0 @@ -version: 2.1 - -jobs: - test: - docker: - - image: circleci/ruby:<< parameters.ruby-version >> - - image: postgres:11.3 - environment: - POSTGRES_USER: postgres - POSTGRES_DB: safer_migrations_test - POSTGRES_PASSWORD: "" - POSTGRES_HOST_AUTH_METHOD: trust - environment: - DATABASE_URL: postgres://postgres@localhost/safer_migrations_test - ACTIVERECORD_VERSION: << parameters.activerecord-version >> - parameters: - ruby-version: - type: string - activerecord-version: - type: string - steps: - - checkout - - restore_cache: - keys: - - bundle-v1-<< parameters.ruby-version >>-{{ checksum "activerecord-safer_migrations.gemspec" }} - - bundle-v1-<< parameters.ruby-version >>- - - run: - name: Install dependencies - command: bundle install --clean --no-cache --path vendor/bundle --jobs=4 --retry=3 - - save_cache: - key: bundle-v1-<< parameters.ruby-version >>-{{ checksum "activerecord-safer_migrations.gemspec" }} - paths: - - vendor/bundle - - run: - name: Run tests - command: bundle exec rspec - - run: - name: Run rubocop - command: bundle exec rubocop --parallel --extra-details --display-style-guide - -workflows: - default: - jobs: - - test: - name: "Ruby << matrix.ruby-version >> : ActiveRecord << matrix.activerecord-version >>" - matrix: - parameters: - activerecord-version: - - 5.2.4.4 - - 6.0.3.3 - ruby-version: - - 2.5.8 - - 2.6.6 - - 2.7.1 - # - 3.0.0-preview1 diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..452ebb3 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,7 @@ +version: 2 +updates: +- package-ecosystem: bundler + directory: "/" + schedule: + interval: daily + open-pull-requests-limit: 10 diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml new file mode 100644 index 0000000..8b3f8eb --- /dev/null +++ b/.github/workflows/tests.yml @@ -0,0 +1,60 @@ +name: tests + +on: + push: + branches: + - "master" + pull_request: + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + rubocop: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: ruby/setup-ruby@v1 + with: + bundler-cache: true + - run: bundle exec rubocop --extra-details --display-style-guide --parallel --force-exclusion + + tests: + strategy: + fail-fast: false + matrix: + ruby-version: ["3.1", "3.2", "3.3"] + activerecord-version: + - "7.0.8" + - "7.1.3.4" + - "7.2.0" + runs-on: ubuntu-latest + services: + postgres: + image: postgres:14 + env: + POSTGRES_USER: postgres + POSTGRES_DB: safer_migrations_test + POSTGRES_PASSWORD: safer_migrations + ports: + - 5432:5432 + options: >- + --health-cmd pg_isready + --health-interval 10s + --health-timeout 5s + --health-retries 10 + env: + DATABASE_URL: postgres://postgres:safer_migrations@localhost/safer_migrations_test + DATABASE_DEPENDENCY_PORT: "5432" + ACTIVERECORD_VERSION: "${{ matrix.activerecord-version }}" + steps: + - uses: actions/checkout@v4 + - name: Set up Ruby + uses: ruby/setup-ruby@v1 + with: + bundler-cache: true + ruby-version: "${{ matrix.ruby-version }}" + - name: Run specs + run: | + bundle exec rspec --profile --format progress diff --git a/.rubocop.yml b/.rubocop.yml index 1004c33..f178713 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -1,10 +1,17 @@ -inherit_from: .rubocop_todo.yml - inherit_gem: gc_ruboconfig: rubocop.yml AllCops: - TargetRubyVersion: 2.7 + TargetRubyVersion: 3.2 + NewCops: enable Gemspec/RequiredRubyVersion: Enabled: false + +Naming/FileName: + Exclude: + - lib/activerecord-safer_migrations.rb + +Style/GlobalVars: + Exclude: + - "spec/active_record/safer_migrations/migration_spec.rb" diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml deleted file mode 100644 index 836e7bf..0000000 --- a/.rubocop_todo.yml +++ /dev/null @@ -1,20 +0,0 @@ -# This configuration was generated by -# `rubocop --auto-gen-config` -# on 2018-03-27 12:04:06 +0100 using RuboCop version 0.54.0. -# The point is for the user to remove these configuration records -# one by one as the offenses are removed from the code base. -# Note that changes in the inspected code, or installation of new -# versions of RuboCop, may require this file to be generated again. - -# Offense count: 1 -# Configuration parameters: ExpectMatchingDefinition, Regex, IgnoreExecutableScripts, AllowedAcronyms. -# AllowedAcronyms: CLI, DSL, ACL, API, ASCII, CPU, CSS, DNS, EOF, GUID, HTML, HTTP, HTTPS, ID, IP, JSON, LHS, QPS, RAM, RHS, RPC, SLA, SMTP, SQL, SSH, TCP, TLS, TTL, UDP, UI, UID, UUID, URI, URL, UTF8, VM, XML, XMPP, XSRF, XSS -Naming/FileName: - Exclude: - - 'lib/activerecord-safer_migrations.rb' - -# Offense count: 20 -# Configuration parameters: AllowedVariables. -Style/GlobalVars: - Exclude: - - 'spec/active_record/safer_migrations/migration_spec.rb' diff --git a/.ruby-version b/.ruby-version index 860487c..a0891f5 100644 --- a/.ruby-version +++ b/.ruby-version @@ -1 +1 @@ -2.7.1 +3.3.4 diff --git a/CHANGELOG.md b/CHANGELOG.md index 602833e..17397ff 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +# 4.0.0 / 2024-08-21 + +- Remove support for Ruby =< 3.0 and Rails =< 6.0 + # 3.0.0 / 2020-09-28 - [#55](https://github.com/gocardless/activerecord-safer_migrations/pull/55) Drop support for Ruby =< 2.4 and Rails =< 5.1 diff --git a/Gemfile b/Gemfile index 1734ecb..e230e70 100644 --- a/Gemfile +++ b/Gemfile @@ -5,4 +5,9 @@ source "https://rubygems.org" gemspec gem "activerecord", "~> #{ENV['ACTIVERECORD_VERSION']}" if ENV["ACTIVERECORD_VERSION"] -gem "gc_ruboconfig", "~> 2.19.0" + +group :test, :development do + gem "gc_ruboconfig", "~> 5.0" + gem "pg", "~> 1.4" + gem "rspec", "~> 3.9.0" +end diff --git a/activerecord-safer_migrations.gemspec b/activerecord-safer_migrations.gemspec index 51888a7..626054d 100644 --- a/activerecord-safer_migrations.gemspec +++ b/activerecord-safer_migrations.gemspec @@ -14,11 +14,8 @@ Gem::Specification.new do |gem| gem.homepage = "https://github.com/gocardless/activerecord-safer_migrations" gem.license = "MIT" - gem.required_ruby_version = ">= 2.5" + gem.required_ruby_version = ">= 3.1" - gem.add_runtime_dependency "activerecord", ">= 5.2" - - gem.add_development_dependency "pg", "~> 1.2.3" - gem.add_development_dependency "rspec", "~> 3.9.0" - gem.add_development_dependency "rubocop", "~> 0.92.0" + gem.add_dependency "activerecord", ">= 7.0" + gem.metadata["rubygems_mfa_required"] = "true" end diff --git a/lib/active_record/safer_migrations/version.rb b/lib/active_record/safer_migrations/version.rb index 945e8d9..460d317 100644 --- a/lib/active_record/safer_migrations/version.rb +++ b/lib/active_record/safer_migrations/version.rb @@ -2,6 +2,6 @@ module ActiveRecord module SaferMigrations - VERSION = "3.0.0" + VERSION = "4.0.0" end end diff --git a/lib/activerecord-safer_migrations.rb b/lib/activerecord-safer_migrations.rb index 34f80d4..68c6798 100644 --- a/lib/activerecord-safer_migrations.rb +++ b/lib/activerecord-safer_migrations.rb @@ -37,4 +37,4 @@ def self.load end end -require "active_record/safer_migrations/railtie" if defined?(::Rails) +require "active_record/safer_migrations/railtie" if defined?(Rails)