From b08e382943937ea40fedf1422a13c00498e4ac1d Mon Sep 17 00:00:00 2001 From: Peer Allan Date: Mon, 10 Jun 2024 12:40:08 -0500 Subject: [PATCH 1/3] Add github action for CI --- .github/workflows/ci.yaml | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 .github/workflows/ci.yaml diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml new file mode 100644 index 0000000..0b15920 --- /dev/null +++ b/.github/workflows/ci.yaml @@ -0,0 +1,29 @@ +--- +name: CI + +on: + workflow_dispatch: + push: + branches: [ "ci" ] + pull_request: + branches: [ "ci" ] + +permissions: + contents: read + +jobs: + test: + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + ruby-version: + - 2.7 + steps: + - uses: actions/checkout@v4 + - uses: ruby/setup-ruby@v1 + with: + ruby-version: "${{ matrix.ruby-version }}" + bundler-cache: true + - name: Run tests + run: bundle exec rspec --format documentation From a2d9cff26a305ec63c45a940322e84ef1e9e265b Mon Sep 17 00:00:00 2001 From: Peer Allan Date: Mon, 10 Jun 2024 13:09:37 -0500 Subject: [PATCH 2/3] Update for ActiveRecord version matrix --- .github/workflows/ci.yaml | 4 ++ Gemfile | 13 +++++++ Gemfile.lock | 63 -------------------------------- inheritance_integer_type.gemspec | 2 +- 4 files changed, 18 insertions(+), 64 deletions(-) delete mode 100644 Gemfile.lock diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 0b15920..3db45b6 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -19,6 +19,10 @@ jobs: matrix: ruby-version: - 2.7 + active-record-version: + - 5.2.0 + env: + ACTIVE_RECORD_VERSION: "${{ matrix.active-record-version }}" steps: - uses: actions/checkout@v4 - uses: ruby/setup-ruby@v1 diff --git a/Gemfile b/Gemfile index 0fe5829..bb44130 100644 --- a/Gemfile +++ b/Gemfile @@ -2,3 +2,16 @@ source 'https://rubygems.org' # Specify your gem's dependencies in inheritance_integer_type.gemspec gemspec + +ar_version = ENV["ACTIVE_RECORD_VERSION"] || "default" + +ar = case ar_version +when "master" + { github: "rails/rails" } +when "default" + ">= 5.2" +else + "~> #{ar_version}" +end + +gem "activerecord", ar diff --git a/Gemfile.lock b/Gemfile.lock deleted file mode 100644 index 28845fa..0000000 --- a/Gemfile.lock +++ /dev/null @@ -1,63 +0,0 @@ -PATH - remote: . - specs: - inheritance_integer_type (0.1.3) - -GEM - remote: https://rubygems.org/ - specs: - activemodel (5.2.8.1) - activesupport (= 5.2.8.1) - activerecord (5.2.8.1) - activemodel (= 5.2.8.1) - activesupport (= 5.2.8.1) - arel (>= 9.0) - activesupport (5.2.8.1) - concurrent-ruby (~> 1.0, >= 1.0.2) - i18n (>= 0.7, < 2) - minitest (~> 5.1) - tzinfo (~> 1.1) - arel (9.0.0) - coderay (1.1.3) - concurrent-ruby (1.2.2) - diff-lcs (1.5.0) - i18n (1.14.1) - concurrent-ruby (~> 1.0) - method_source (1.0.0) - minitest (5.20.0) - pry (0.14.2) - coderay (~> 1.1) - method_source (~> 1.0) - rake (13.1.0) - rspec (3.12.0) - rspec-core (~> 3.12.0) - rspec-expectations (~> 3.12.0) - rspec-mocks (~> 3.12.0) - rspec-core (3.12.2) - rspec-support (~> 3.12.0) - rspec-expectations (3.12.3) - diff-lcs (>= 1.2.0, < 2.0) - rspec-support (~> 3.12.0) - rspec-mocks (3.12.6) - diff-lcs (>= 1.2.0, < 2.0) - rspec-support (~> 3.12.0) - rspec-support (3.12.1) - sqlite3 (1.3.13) - thread_safe (0.3.6) - tzinfo (1.2.11) - thread_safe (~> 0.1) - -PLATFORMS - ruby - -DEPENDENCIES - activerecord (< 6.0) - bundler - inheritance_integer_type! - pry - rake - rspec - sqlite3 (~> 1.3.6) - -BUNDLED WITH - 2.4.21 diff --git a/inheritance_integer_type.gemspec b/inheritance_integer_type.gemspec index fe34f32..a58ed2a 100644 --- a/inheritance_integer_type.gemspec +++ b/inheritance_integer_type.gemspec @@ -21,7 +21,7 @@ Gem::Specification.new do |spec| spec.add_development_dependency "bundler" spec.add_development_dependency "rake" spec.add_development_dependency "rspec" - spec.add_development_dependency "activerecord", "< 6.0" + spec.add_development_dependency "activerecord", ">= 5.2" spec.add_development_dependency "sqlite3", "~> 1.3.6" spec.add_development_dependency "pry" end From b8844e5aca121665c4f9a78470dd57f0c48d08a8 Mon Sep 17 00:00:00 2001 From: Peer Allan Date: Mon, 10 Jun 2024 13:47:12 -0500 Subject: [PATCH 3/3] Remove branch dependencies for CI run --- .github/workflows/ci.yaml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 3db45b6..5d1c4ba 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -3,10 +3,7 @@ name: CI on: workflow_dispatch: - push: - branches: [ "ci" ] pull_request: - branches: [ "ci" ] permissions: contents: read