Skip to content
This repository has been archived by the owner on Feb 9, 2021. It is now read-only.

Ruby 2.6.3 support #8

Closed
yahonda opened this issue Aug 13, 2019 · 30 comments
Closed

Ruby 2.6.3 support #8

yahonda opened this issue Aug 13, 2019 · 30 comments
Assignees

Comments

@yahonda
Copy link

yahonda commented Aug 13, 2019

I'm testing GitHub Actions for our internal Rails application using Ruby 2.6.3.
It looks like the latest version of Ruby 2.6 GitHub Actions supports is 2.6.2. I'd like to know how to run Ruby 2.6.3.

  • .github/workflows/ruby.yml
name: Ruby

on: [push]

jobs:
  build:

    runs-on: ubuntu-latest

    steps:
    - uses: actions/checkout@master
    - name: Set up Ruby 2.6
      uses: actions/setup-ruby@v1
      with:
        version: 2.6.x
    - name: Build and test with Rake
      run: |
        gem install bundler
        bundle install --jobs 4 --retry 3
        bundle exec rake
  • Gemfile (partial one to show Ruby 2.6.3 is specified)
# frozen_string_literal: true

source 'https://rubygems.org'
git_source(:github) { |repo| "https://github.com/#{repo}.git" }

ruby '2.6.3'

# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '~> 6.0.0.rc2'

Actual behavior

Your Ruby version is 2.6.2, but your Gemfile specified 2.6.3

Expected behavior

Ruby 2.6.3 is installed by version: 2.6.x

@eregon
Copy link
Contributor

eregon commented Aug 13, 2019

Same here, I expected 2.6.3 to be available and used by version: 2.6.x.
For 2.4.x and 2.5.x, it seems the latest Ruby releases are correctly used (2.4.6 and 2.5.5).

Is there a list of available Ruby versions for GitHub actions?

@damccorm
Copy link
Contributor

I'd like to know how to run Ruby 2.6.3

Right now, we don't have a way to download/install ruby since there's not a well defined distro (at least that I know of) where we can get prebuilt packages, so we're reliant on the versions installed in the tool cache.

With that said, you can do this using a run: step - linux/mac steps here - https://www.ruby-lang.org/en/documentation/installation/, windows steps here - https://stackoverflow.com/a/22959385

I expected 2.6.3 to be available

@kaylangan are we expecting the newest version of Ruby to be added soon? Guessing we're just a step behind here since that's the most recent release

Is there a list of available Ruby versions for GitHub actions?

You can list available versions by running run: ls $RUNNER_TOOL_CACHE/Ruby. Right now, for ubuntu I'm seeing:
2.3.7
2.4.6
2.5.5
2.6.2

@yahonda
Copy link
Author

yahonda commented Aug 14, 2019

Thanks for the update. If I understand your advice correctly,
Installing Ruby followed by the instruction https://www.ruby-lang.org/en/documentation/installation/#apt insalls Ruby 2.5.1.

Your Ruby version is 2.5.1, but your Gemfile specified 2.6.3

I think this is an expected version from Ubuntu point of view.

https://packages.ubuntu.com/disco/ruby-full
https://packages.ubuntu.com/disco/ruby

$ git diff e3b0e72785f0f3ea7724de247ee0b182140e0bb5...52d160ddece05abd64511bb2650e07850184991a
diff --git a/.github/workflows/ruby.yml b/.github/workflows/ruby.yml
index b61895f..4b72cfd 100644
--- a/.github/workflows/ruby.yml
+++ b/.github/workflows/ruby.yml
@@ -9,12 +9,9 @@ jobs:

     steps:
     - uses: actions/checkout@master
-    - name: Set up Ruby 2.6
-      uses: actions/setup-ruby@v1
-      with:
-        version: 2.6.x
     - name: Build and test with Rake
       run: |
-        gem install bundler
-        bundle install --jobs 4 --retry 3
+        sudo apt-get install ruby-full
+        sudo gem install bundler -v 1.17.3
+        sudo bundle install --jobs 4 --retry 3
         bundle exec rake
$

We have another CI running Ruby 2.6.3 and testing GitHub Actions.
Then I'd like to wait for Ruby 2.6.3 available at GitHub Actions.

@eregon
Copy link
Contributor

eregon commented Aug 15, 2019

Would a solution here be to add Ruby 2.6.3 to the tool cache? I think that would be the most straightforward approach.
I also noticed that on Windows Ruby 2.4.5 is used (the latest release of 2.4.x is 2.4.6).

How are versions in the hostedtoolcache added? Are they compiled from source and shared across runners of the same virtual environment (OS, OS version, arch)?

FWIW I can recommend ruby-install or ruby-build to build Rubies conveniently and in a simple straightforward way. Building from source is also easy on Linux and macOS.
For Windows, there are prebuilt Ruby binaries.

The Ruby version provided by the operating system is often outdated and usually only one version is available. I would think most Rubyists expect to have all the most recent Ruby versions available in CI (presently 2.4.6, 2.5.5, 2.6.3).

@damccorm
Copy link
Contributor

Would a solution here be to add Ruby 2.6.3 to the tool cache?

Yeah, sorry if I wasn't clear in my initial response - that is the right solution and something I think we will do.

How are versions in the hostedtoolcache added? Are they compiled from source and shared across runners of the same virtual environment (OS, OS version, arch)?

I think so. We regenerate our images frequently and as part of that process we update the tool cache with some prebuilt tools. @kaylangan would know more about that process.

@kieranklaassen
Copy link

Would love to get 2.6.3 in here!

@kaylangan
Copy link

We're currently in the process of updating Ruby 2.6.x to 2.6.3 across the board. The changes are in review. The update should go out in the next week or so.

How are versions in the hostedtoolcache added? Are they compiled from source and shared across runners of the same virtual environment (OS, OS version, arch)?

For Windows, we use rubyinstaller. For the other images, we compile from source.

The Ruby version provided by the operating system is often outdated and usually only one version is available. I would think most Rubyists expect to have all the most recent Ruby versions available in CI (presently 2.4.6, 2.5.5, 2.6.3).

Agreed, we need to update the versions that we offer in the cache. The last time we updated the latest versions weren't available from rubyinstaller but they are now. We'll get that in.

@dentarg
Copy link

dentarg commented Aug 16, 2019

@damccorm

Right now, we don't have a way to download/install ruby since there's not a well defined distro (at least that I know of) where we can get prebuilt packages

Have you looked into somehow utilizing the work that is being done by the Docker community? https://github.com/docker-library/ruby that is

@kaylangan

We're currently in the process of updating Ruby 2.6.x to 2.6.3 across the board. The changes are in review. The update should go out in the next week or so.

For Windows, we use rubyinstaller. For the other images, we compile from source.

Is these efforts open source? If not, have you considered having them open source?

@damccorm
Copy link
Contributor

Have you looked into somehow utilizing the work that is being done by the Docker community? https://github.com/docker-library/ruby that is

I hadn't - that might be a helpful resource, thanks for the pointer!

From a glance, it looks like those are only Linux packages though, and that they're actually building Ruby for their images, not releasing a Linux Ruby package. In general, we want to avoid building Ruby as part of this action because that tends to just take too long (that's a consistent choice across our setup-* actions). Note that we do offer the choice to consume those ruby images in container actions though

@kaylangan
Copy link

Is these efforts open source? If not, have you considered having them open source?

It's not currently open source but we are considering it.

@eregon
Copy link
Contributor

eregon commented Aug 24, 2019

@yahonda It seems 2.6.3 was added now (e.g.: https://github.com/ruby/spec/pull/683/checks?check_run_id=202172160), I think we can close this issue.

@yahonda
Copy link
Author

yahonda commented Aug 24, 2019

I have confirmed Ruby 2.6.3 is available at GitHub Actions.

@yahonda
Copy link
Author

yahonda commented Aug 24, 2019

Closing this issue. Thanks for the support.

@yahonda yahonda closed this as completed Aug 24, 2019
@matchai
Copy link

matchai commented Aug 24, 2019

It appears Ruby 2.6.3 is available on ubuntu-latest and macOS-latest, but not yet on windows-latest.

You can list available versions by running run: ls $RUNNER_TOOL_CACHE/Ruby

@damccorm: Unfortunately, the above command doesn't work on the windows environments. I'm having a tough time finding any fixed Ruby versions that are available on all three environments.

Version Ubuntu macOS Windows
2.3.7
2.4.5
2.4.6
2.5.3
2.5.5
2.6.1
2.6.2
2.6.3

@MSP-Greg
Copy link
Contributor

@matchai

Re Windows Ruby builds:

For Ruby 2.3 and earlier, RubyInstaller/msys builds stopped being supported, so current versions are not available.

For Ruby 2.4 and later, RubyInstaller2/msys2 builds are used, but it's uncommon for any CI to have anything but the latest available (dependent on how often the images are updated)...

@kaylangan
Copy link

2.6.3 for Windows is in the process of rolling out. I will close this when it's available to all accounts.

@kaylangan kaylangan reopened this Aug 24, 2019
@kaylangan
Copy link

Also for Windows, 2.4.5 will be bumped to 2.4.6 and 3.5.3 to 3.5.5

@dentarg
Copy link

dentarg commented Aug 26, 2019

@kaylangan did you remove 2.6.2 when adding 2.6.3? I'm using ubuntu-latest

@kaylangan
Copy link

@dentarg yes, 2.6.2 bumped to 2.6.3

@dentarg
Copy link

dentarg commented Aug 26, 2019

@kaylangan I'm not sure that's a good behaviour for a CI service, many of our projects still specify 2.6.2 as their version, and CI breaking without us doing anything feels wrong

@kaylangan
Copy link

@dentarg do you need 2.6.2 or just 2.6.x?

@dentarg
Copy link

dentarg commented Aug 26, 2019

@kaylangan I need 2.6.2, I prefer to control the exact version my projects are using

@matchai
Copy link

matchai commented Aug 26, 2019

CI breaking without us doing anything feels wrong

I share this sentiment completely. Coming from Azure Pipelines, this was my biggest peeve with Tool Tasks. My projects depend on fixed versions of tools. Having the available versions change overnight was the frequent cause for false positives in CI. I'm really hoping that this can be changed in Actions.

If there is more appropriate place to discuss general tool cache issues, I'd be happy to move this discussion there. 🙂

@kaylangan
Copy link

@dentarg @matchai Got it. For now, you should expect versions to slide (e.g. 2.6.x). However, we are working on a solution where you would be able to pick a specific patch version such as 2.6.2 (though it may have to be downloaded so your builds may take a little longer).

@metaskills
Copy link

In general, we want to avoid building Ruby as part of this action because that tends to just take too long (that's a consistent choice across our setup-* actions). Note that we do offer the choice to consume those ruby images in container actions though

Thanks for sharing that, I did not expect this but I see the point. Right now I am in the process of switching my Minitest Spec Rails (metaskills/minitest-spec-rails#95) gem over GitHub Actions from TravisCI.

I think one day people would be interested in another community action that leverages something like rbenv's ruby-build (https://github.com/rbenv/ruby-build) which does work just fine on Ubuntu & Mac. But I totally see the value in using existing software installed in each virtual env (https://help.github.com/en/articles/software-in-virtual-environments-for-github-actions) too. Thanks for your work too!

tomstuart added a commit to tomstuart/monads that referenced this issue Sep 8, 2019
According to actions/setup-ruby#8, this is the most we can rely on for now. GitHub Actions will support specific patch releases of Ruby in the future.
@AstmDesign
Copy link

AstmDesign commented Sep 16, 2019

when I added

      with:
        ruby-version: 2.5.x

I got
Your Ruby version is 2.5.5, but your Gemfile specified 2.5.3
because in my Gemfile my version is 2.5.3 an I'm using Ubuntu as OS

@kaylangan
Copy link

Ruby 2.6.3 is now available on all OS's.

@AstmDesign if your Gemfile requires 2.5.3, you should specify 2.5.3. However, our images will slide to use the latest so right now, it only have 2.5.5.

@AstmDesign
Copy link

@kaylangan yes, I upgraded my ruby version to 2.6.3 and it working well now,

@joegaudet
Copy link

@kaylangan seeing the same issue now with 2.5.6.

@createbyte
Copy link

is ruby 2.6.3 available for windows yet?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests