Skip to content

Matrix with 3.0 value will install 3.1 ruby #252

@ShockwaveNN

Description

@ShockwaveNN

I'm not totally sure that this is issue in ruby/setup-ruby iselft, but let me describe it

For quite a long time I've used this code block in different github actions in my different projects

name: Ruby
on: [push]
jobs:
  build:
    runs-on: ubuntu-latest
    continue-on-error: ${{ matrix.allow-failures }}
    strategy:
      matrix:
        ruby: [2.5, 2.6, 2.7, 3.0]
        allow-failures: [false]
        include:
          - ruby: head
            allow-failures: true
    steps:
    - uses: actions/checkout@v2
    ....all_other_steps

This worked well, it set up several ruby versions and run my tests

But with the release of ruby v3.1 I've noticed a very strange situation

That instead of v3.0 is v3.1 actually installed

You can take a look at that workflow
On Setup Ruby 3 stage in logs we see that:

Installing Bundler
  Using Bundler 2.3.2 from Gemfile.lock BUNDLED WITH 2.3.2
  /opt/hostedtoolcache/Ruby/3.1.0/x64/bin/gem install bundler -v 2.3.2
  Successfully installed bundler-2.3.2
  1 gem installed
  Took   0.57 seconds

First of all - I fought 'oh my bad, seems that if I send version as interger and not strings if will install latest major version

But I've rechecked version 2.6 - it send in config as 2.6, not a '2.6' and still installing it correctly, not latest v2.7

I see in docs - https://github.com/ruby/setup-ruby#matrix-of-ruby-versions that 3.0 is in quotes, but I don't quite get why only 3.0 need quotes?

And if quotes are really required - maybe add some readme statement about this to clarify reasons?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions