diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml new file mode 100644 index 0000000..5d1c4ba --- /dev/null +++ b/.github/workflows/ci.yaml @@ -0,0 +1,30 @@ +--- +name: CI + +on: + workflow_dispatch: + pull_request: + +permissions: + contents: read + +jobs: + test: + runs-on: ubuntu-latest + strategy: + fail-fast: false + 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 + with: + ruby-version: "${{ matrix.ruby-version }}" + bundler-cache: true + - name: Run tests + run: bundle exec rspec --format documentation 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