diff --git a/.github/actions/setup-rubygems/action.yml b/.github/actions/setup-rubygems/action.yml index def79a6..8b8c20b 100644 --- a/.github/actions/setup-rubygems/action.yml +++ b/.github/actions/setup-rubygems/action.yml @@ -1,18 +1,12 @@ name: Setup RubyGems description: Setup RubyGems credentials inputs: - ruby-version: - description: Ruby version - required: true rubygems_api_key: description: RubyGems API key required: true runs: using: composite steps: - - uses: ruby/setup-ruby@v1 - with: - ruby-version: ${{ inputs.ruby-version }} - run: mkdir -p ~/.gem shell: bash - run: | diff --git a/.github/actions/test/action.yml b/.github/actions/test/action.yml index 18b65ac..a36db97 100644 --- a/.github/actions/test/action.yml +++ b/.github/actions/test/action.yml @@ -1,19 +1,13 @@ name: Test description: Run tests inputs: - ruby-version: - description: Ruby version - required: true activesupport-version: description: ActiveSupport version constraint required: true runs: using: composite steps: - - uses: ruby/setup-ruby@v1 - with: - ruby-version: ${{ inputs.ruby-version }} - - run: gem install activesupport -v "~> ${{ inputs.activesupport-version }}" + - run: bundle add activesupport -v '${{ inputs.activesupport-version }}' shell: bash - run: bundle install shell: bash diff --git a/.github/workflows/test-release.yml b/.github/workflows/test-release.yml index 8724c23..c3fe85e 100644 --- a/.github/workflows/test-release.yml +++ b/.github/workflows/test-release.yml @@ -8,35 +8,42 @@ on: jobs: test: name: >- - Ruby ${{ matrix.ruby }}, ActiveSupport ~> ${{ matrix.activesupport }} + Test + [Ruby ${{ matrix.ruby-version }}, + ActiveSupport ${{ matrix.activesupport-version }}] runs-on: ubuntu-latest strategy: matrix: - activesupport: - - "3.2" - - "4.0" - - "5.0" - - "6.0" - - "7.0" - ruby: + activesupport-version: + - ~> 3.2 + - ~> 4.0 + - ~> 5.0 + - ~> 6.0 + - ~> 7.0 + ruby-version: - "3.1" - "3.2" steps: - uses: actions/checkout@v3 + - uses: ruby/setup-ruby@v1 + with: + ruby-version: ${{ matrix.ruby-version }} - uses: ./.github/actions/test with: - ruby-version: ${{ matrix.ruby }} - activesupport-version: ${{ matrix.activesupport }} + activesupport-version: ${{ matrix.activesupport-version }} push: + name: Publish Gem if: ${{ github.event.release }} needs: - test runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - - uses: ./.github/actions/setup-rubygems + - uses: ruby/setup-ruby@v1 with: ruby-version: "3.2" + - uses: ./.github/actions/setup-rubygems + with: rubygems_api_key: ${{ secrets.RUBYGEMS_API_KEY }} - run: bundle install - run: bundle exec rake gem:push diff --git a/configs.gemspec b/configs.gemspec index b16158a..837045f 100644 --- a/configs.gemspec +++ b/configs.gemspec @@ -17,7 +17,7 @@ Gem::Specification.new do |gem| gem.license = 'MIT' gem.add_dependency 'activesupport', '> 3.0' - gem.add_development_dependency 'minitest', '~> 4.0' + gem.add_development_dependency 'minitest', '> 4', '< 5.19' gem.add_development_dependency 'rake' gem.required_ruby_version = '~> 3.1'