Skip to content

Latest commit

 

History

History
55 lines (46 loc) · 1.46 KB

README.md

File metadata and controls

55 lines (46 loc) · 1.46 KB

Ruby version determination

Determine the Ruby versions for your testing matrix based on the gemspec.

Maintaining your CI is tedious and your gem can already specify the compatible Ruby versions using required_ruby_version. This action reads your gemspec and provides an output of compatible Ruby versions.

Supported Ruby versions

A static list of compatible versions is maintained. This is a subset of setup-ruby's supported versions.

  • 3.4
  • 3.3
  • 3.2
  • 3.1
  • 3.0
  • 2.7
  • 2.6
  • 2.5
  • 2.4

Example

A minimal example has a single job to determine the Ruby version matrix, using this repository. Then there should be some task that uses the matrix, but the exact steps likely differ.

jobs:
  setup_matrix:
    name: "Determine Ruby versions"
    runs-on: ubuntu-latest
    outputs:
      ruby: ${{ steps.ruby.outputs.versions }}
    steps:
      - id: ruby
        uses: voxpupuli/ruby-version@v1

  test:
    name: "Ruby ${{ matrix.ruby }}"
    runs-on: ubuntu-latest
    needs: setup_matrix
    strategy:
      matrix:
        ruby: ${{ fromJSON(needs.setup_matrix.outputs.ruby) }}
    steps:
      - uses: actions/checkout@v4
      - name: Setup ruby
        uses: ruby/setup-ruby@v1
        with:
          ruby-version: ${{ matrix.ruby }}
          bundler-cache: true
      - name: Run tests
        run: bundle exec rake test