From f52fc507f1de1c5433ada957ce85ffe89889f9b5 Mon Sep 17 00:00:00 2001 From: Yuji Yaginuma Date: Thu, 26 Oct 2023 10:33:43 +0900 Subject: [PATCH 1/3] CI against Rails 7.1 --- .github/workflows/test.yaml | 5 +++++ gemfiles/7.1.gemfile | 3 +++ 2 files changed, 8 insertions(+) create mode 100644 gemfiles/7.1.gemfile diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index e905abc5..52de0197 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -22,11 +22,16 @@ jobs: ruby: - 3.2 env: + - AR_VERSION: '7.1' + RUBYOPT: --enable-frozen-string-literal - AR_VERSION: '7.0' RUBYOPT: --enable-frozen-string-literal - AR_VERSION: 6.1 RUBYOPT: --enable-frozen-string-literal include: + - ruby: 3.1 + env: + AR_VERSION: '7.1' - ruby: 3.1 env: AR_VERSION: '7.0' diff --git a/gemfiles/7.1.gemfile b/gemfiles/7.1.gemfile new file mode 100644 index 00000000..fbc1d8c5 --- /dev/null +++ b/gemfiles/7.1.gemfile @@ -0,0 +1,3 @@ +# frozen_string_literal: true + +gem 'activerecord', '~> 7.1.0' From 5a7a61270cf8f4201ee7c31b6d738f7ae7b527f2 Mon Sep 17 00:00:00 2001 From: Yuji Yaginuma Date: Thu, 26 Oct 2023 10:46:34 +0900 Subject: [PATCH 2/3] Correctly set `index` to `version` column Rails checks options in migration since Rails 7.1. Ref: https://github.com/rails/rails/pull/46178 --- test/schema/generic_schema.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/test/schema/generic_schema.rb b/test/schema/generic_schema.rb index c9dd6fac..f1554b25 100644 --- a/test/schema/generic_schema.rb +++ b/test/schema/generic_schema.rb @@ -2,8 +2,10 @@ ActiveRecord::Schema.define do create_table :schema_info, force: :cascade do |t| - t.integer :version, unique: true + t.integer :version end + add_index :schema_info, :version, unique: true + SchemaInfo.create version: SchemaInfo::VERSION create_table :group, force: :cascade do |t| From ec6e29e82367684da0aade49e27a9d2e6c3f37d1 Mon Sep 17 00:00:00 2001 From: Yuji Yaginuma Date: Thu, 26 Oct 2023 11:04:35 +0900 Subject: [PATCH 3/3] Bump `Checkout` action to V4 The `Checkout` action V2 uses old Node.js. It causes a lot of warnings and bump version to fix those. Ref: "Annotations" section in https://github.com/zdennis/activerecord-import/actions/runs/6556382678 --- .github/workflows/test.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index e905abc5..9187a85b 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -71,7 +71,7 @@ jobs: AR_VERSION: ${{ matrix.env.AR_VERSION }} DB_DATABASE: activerecord_import_test steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - uses: ruby/setup-ruby@v1 with: ruby-version: ${{ matrix.ruby }} @@ -110,7 +110,7 @@ jobs: env: AR_VERSION: '7.0' steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - uses: ruby/setup-ruby@v1 with: ruby-version: 2.7