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..b69e589 --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,36 @@ +name: Deploy to RubyGems + +on: + workflow_dispatch: + push: + tags: + - v*.*.* + +permissions: + contents: read + +jobs: + push: + if: github.repository == 'kiskolabs/carpentry' + runs-on: ubuntu-latest + + permissions: + contents: write + id-token: write + + steps: + # Set up + - name: Harden Runner + uses: step-security/harden-runner@v2 + with: + egress-policy: audit + + - uses: actions/checkout@v4 + - name: Set up Ruby + uses: ruby/setup-ruby@v1 + with: + bundler-cache: true + ruby-version: 2.6 + + # Release + - uses: rubygems/release-gem@v1 diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 0225817..0000000 --- a/.travis.yml +++ /dev/null @@ -1,35 +0,0 @@ -sudo: false -dist: xenial -cache: bundler -language: ruby -rvm: - - 2.6 - - 2.7 - - 3.0 -gemfile: - - Gemfile - - Gemfile.rails-5.0.x - - Gemfile.rails-5.1.x - - Gemfile.rails-6.0.x - - Gemfile.rails-6.1.x -jobs: - exclude: - - rvm: 3.0 - gemfile: Gemfile.rails-5.0.x - - rvm: 3.0 - gemfile: Gemfile.rails-5.1.x -script: "./bin/rspec spec" -before_install: - - gem install bundler -notifications: - email: false -deploy: - provider: rubygems - api_key: - secure: Qng7FzbYWSU+R5Ou+hsg3EiyGwWQ2DVEP/Oc3zksVBT0zGy+/c2XgIvbZvw9KdcR0TNW4sLa135twwyQS5Qnfjq/jogKrBnR9uHvxvvVIIvN/kPO8HG0XFXg4IW+M/pbC25iZMo/x1HnYlKqWpCol8d86fbtjL8tT/clB10ulRM= - gem: carpentry - on: - tags: true - repo: kiskolabs/carpentry - ruby: 2.4 - condition: "$BUNDLE_GEMFILE = $PWD/Gemfile" 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__)