diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..3b4423d --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,54 @@ +name: CI + +concurrency: + group: ${{ github.workflow }}-${{ github.ref_name }} + cancel-in-progress: true + +on: + workflow_call: + push: + branches: + - kiskolabs/add_rails_6.1_and_ruby_3_4 + + pull_request: + branches: + - kiskolabs/add_rails_6.1_and_ruby_3_4 + +jobs: + test: + runs-on: ubuntu-latest + + strategy: + matrix: + ruby: ['2.6', '2.7', '3.0', '3.4'] + gemfile: + - Gemfile + - Gemfile.rails-5.0.x + - Gemfile.rails-5.1.x + - Gemfile.rails-6.0.x + - Gemfile.rails-6.1.x + + exclude: + - ruby: 3.0 + gemfile: Gemfile.rails-5.0.x + - ruby: 3.4 + gemfile: Gemfile.rails-5.0.x + - ruby: 3.0 + gemfile: Gemfile.rails-5.1.x + - ruby: 3.4 + gemfile: Gemfile.rails-5.1.x + + steps: + - name: Checkout code + uses: actions/checkout@v4 + - name: Set up Ruby + uses: ruby/setup-ruby@v1 + with: + ruby-version: ${{ matrix.ruby }} + bundler: '2.4' + bundler-cache: true + cache-version: 1 # ignore contents of the cache and get and build all the gems anew. + + - name: Run tests + run: | + bundle exec rspec diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 0000000..3f48cee --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,33 @@ +name: Deploy to RubyGems + +on: + workflow_dispatch: + push: + tags: + - '*' + branches: + - kiskolabs/gha-publish-to-rubygems + +jobs: + test: + uses: ./.github/workflows/ci.yml + push: + runs-on: ubuntu-latest + needs: [test] + permissions: + contents: write + id-token: write + steps: + - name: Test + run: | + echo "Testing successful case" + + # - uses: actions/checkout@v4 + # - name: Set up Ruby + # uses: ruby/setup-ruby@v1 + # with: + # bundler-cache: true + # ruby-version: 3.0 + + # # Release + # - uses: rubygems/release-gem@v1 diff --git a/.travis.yml b/.travis.yml index 0225817..96c8bdf 100644 --- a/.travis.yml +++ b/.travis.yml @@ -6,6 +6,7 @@ rvm: - 2.6 - 2.7 - 3.0 + - 3.4 gemfile: - Gemfile - Gemfile.rails-5.0.x @@ -16,11 +17,15 @@ jobs: exclude: - rvm: 3.0 gemfile: Gemfile.rails-5.0.x + - rvm: 3.4 + gemfile: Gemfile.rails-5.0.x - rvm: 3.0 gemfile: Gemfile.rails-5.1.x + - rvm: 3.4 + gemfile: Gemfile.rails-5.1.x script: "./bin/rspec spec" before_install: - - gem install bundler + - gem install bundler -v 2.0 notifications: email: false deploy: diff --git a/carpentry.gemspec b/carpentry.gemspec index 4a77cd2..1ada44f 100644 --- a/carpentry.gemspec +++ b/carpentry.gemspec @@ -17,11 +17,18 @@ Gem::Specification.new do |s| s.files = Dir["{app,lib,config}/**/*"] + ["Rakefile", "Gemfile", "README.md"] - s.add_dependency("railties", ">= 4.2.0", "<= 6.1.4.1") + s.add_dependency("railties", ">= 4.2.0", "~> 6.1.0") s.add_development_dependency "rdoc" - s.add_development_dependency "rails", ">= 4.2.0", "<= 6.1.4.1" - s.add_development_dependency "capybara", "~> 2.13" + s.add_development_dependency "rails", ">= 4.2.0", "~> 6.1.0" + s.add_development_dependency "concurrent-ruby", "<= 1.3.4" + s.add_development_dependency "capybara", ">= 2.13" s.add_development_dependency "autotest-standalone" - s.add_development_dependency "rspec-rails", "~> 3.4" + s.add_development_dependency "rspec-rails" + + if Gem::Version.new(RUBY_VERSION) >= Gem::Version.new('3.4') + s.add_development_dependency "bigdecimal" + s.add_development_dependency "mutex_m" + s.add_development_dependency "drb" + end end diff --git a/lib/carpentry/version.rb b/lib/carpentry/version.rb index 97d19cf..a3692ab 100644 --- a/lib/carpentry/version.rb +++ b/lib/carpentry/version.rb @@ -1,3 +1,3 @@ module Carpentry - VERSION = "2.2.5" + VERSION = "2.2.6" end diff --git a/spec/dummy/config/boot.rb b/spec/dummy/config/boot.rb index ef36047..6266cfc 100644 --- a/spec/dummy/config/boot.rb +++ b/spec/dummy/config/boot.rb @@ -1,5 +1,5 @@ # Set up gems listed in the Gemfile. ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../../../Gemfile', __FILE__) -require 'bundler/setup' if File.exists?(ENV['BUNDLE_GEMFILE']) +require 'bundler/setup' if File.exist?(ENV['BUNDLE_GEMFILE']) $LOAD_PATH.unshift File.expand_path('../../../../lib', __FILE__)