Giter VIP home page Giter VIP logo

setup-ruby's Introduction

setup-ruby

test status

versions status

Please note: This action is deprecated and should no longer be used. The team at GitHub has ceased making and accepting code contributions or maintaining issues tracker. Please, migrate your workflows to the ruby/setup-ruby, which is being actively maintained by the official Ruby organization.

This action sets up a ruby environment for versions which are installed on the Actions Virtual Environments.

Virtual environments contain only one Ruby version within a 'major.minor' release, and are updated with new releases. Hence, a workflow should only be bound to minor versions.

Note that a ruby-version: of 2.6 or 2.6.x are equivalent.

Supports 2.4, 2.5, 2.6, and 2.7.

Usage

See action.yml

Basic:

steps:
- uses: actions/checkout@v2
- uses: actions/setup-ruby@v1
  with:
    ruby-version: '2.6' # Version range or exact version of a Ruby version to use, using semvers version range syntax.
- run: ruby hello.rb

Matrix Testing:

jobs:
  build:
    runs-on: ubuntu-16.04
    strategy:
      matrix:
        ruby: [ '2.5', '2.6' ]
    name: Ruby ${{ matrix.ruby }} sample
    steps:
      - uses: actions/checkout@v2
      - uses: actions/setup-ruby@v1
        with:
          ruby-version: ${{ matrix.ruby }}
      - run: ruby hello.rb

Ruby on Rails Testing:

name: Rails Unit Tests

on: [push, pull_request]

jobs:
  build:

    runs-on: ubuntu-latest

    services:
      db:
        image: postgres:11
        ports: ['5432:5432']
        options: >-
          --health-cmd pg_isready
          --health-interval 10s
          --health-timeout 5s
          --health-retries 5

    steps:
    - uses: actions/checkout@v2
    - name: Set up Ruby 2.6
      uses: actions/setup-ruby@v1
      with:
        ruby-version: 2.6
    - name: Build and test with Rake
      env:
        PGHOST: 127.0.0.1
        PGUSER: postgres
        RAILS_ENV: test
      run: |
        sudo apt-get -yqq install libpq-dev
        gem install bundler
        bundle install --jobs 4 --retry 3
        bundle exec rails db:create
        bundle exec rails db:migrate
        bundle exec rails test

Caching Dependencies

See actions/cache and the Ruby Gem cache example.

License

The scripts and documentation in this project are released under the MIT License

Contributions

Contributions are welcome! See Contributor's Guide

Code of Conduct

๐Ÿ‘‹ Be nice. See our code of conduct

setup-ruby's People

Contributors

alanvardy avatar alenasviridenko avatar bryanmacfarlane avatar dependabot[bot] avatar dmarcey avatar eileencodes avatar eregon avatar ethomson avatar hross avatar joshmgross avatar jwillemsen avatar msp-greg avatar stephenmichaelf avatar thboop avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

setup-ruby's Issues

Ruby version removed without bumping major version

I pinned to setup-ruby@v1 and Ruby 2.6.3, but at some point 2.6.3 disappeared. Could you bump the major version of this action when you make a breaking change such as removing a Ruby version? Otherwise workflows just stop working even though I didn't change any configuration.

Bundle cache

Actions CI with Ruby is far slower than other CI products because it downloads and installs gems every time. For a tiny Rails site this adds about 3 minutes to the runtime, big sites I imagine would be far worse.

Is there a way to do what other CI tools do and cache the bundle folder so that on subsequent runs only updated / new gems are installed?

For example CodeShip says they "automatically configures bundler to use the $HOME/cache/bundler directory, which we save between builds to optimize build performance". I assume they set a default bundler config:

https://bundler.io/v1.1/man/bundle-config.1.html

And then any user supplied bundle install command will use that default config including the cache.

https://bundler.io/bundle_install.html

It looks like --path might be what does it.

Using GitHub Actions with Ruby on Rails and Postgres

I have been working on getting Rails and Postgres to work with Actions without a lot of success.

My difficulty is around connecting to the database. It is declared healthy, but I am not able to find the right combination of environment variables to make the magic happen.
Link to config files

Is there a Rails example I can work off of?

Thank you!

Ruby 3

Ruby 3.0 was released and I'd like to kick its tires in CI to see if the performance gain will be as good as for some of the highlighted scenarios, but it seems setup-ruby does not support 3.0.0 or similar yet. Could this be added? Thank you for this action! โค๏ธ

Ruby 2.5.6 support

Hey, thanks for the great work, just trying out Github actions, were deployed on 2.5.6 which doesn't appear to be available.

Ruby 2.6.3 support

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

setup-ruby fails on macos-latest

A simple workflow like:

on:
  push:
    branches: [ master ]
  pull_request:
    branches: [ master ]

name: Test
jobs:
  test:
    name: Test
    runs-on: macos-latest
    steps:
      - name: Checkout
        uses: actions/checkout@master
      - name: Setup environment
        uses: actions/setup-ruby@v1
        with:
          ruby-version: '2.7.0'

"Succeeds" but when you look at the logs:

 Setup environment
1s
(node:1184) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
Run actions/setup-ruby@v1
(node:1184) UnhandledPromiseRejectionWarning: Error: The process 'sudo' failed with exit code 1
    at ExecState._setResult (/Users/runner/runners/2.165.2/work/_actions/actions/setup-ruby/v1/node_modules/@actions/exec/lib/toolrunner.js:547:25)
    at ExecState.CheckComplete (/Users/runner/runners/2.165.2/work/_actions/actions/setup-ruby/v1/node_modules/@actions/exec/lib/toolrunner.js:530:18)
    at ChildProcess.<anonymous> (/Users/runner/runners/2.165.2/work/_actions/actions/setup-ruby/v1/node_modules/@actions/exec/lib/toolrunner.js:430:27)
    at ChildProcess.emit (events.js:210:5)
sudo ln -sf /Users/runner/hostedtoolcache/Ruby/2.7.0/x64/bin/ruby /usr/bin/ruby
ln: /usr/bin/ruby: Operation not permitted
    at maybeClose (internal/child_process.js:1021:16)
    at Socket.<anonymous> (internal/child_process.js:430:11)
    at Socket.emit (events.js:210:5)
    at Pipe.<anonymous> (net.js:659:12)
(node:1184) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:1184) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

Create a plan and design (ADR) for ruby builds at runtime

@bryanmacfarlane @eileencodes
cc @MSP-Greg
In #44 we agreed on prebuilding Rubies in this repository.
Here I detail some steps to get started with supporting prebuilt Rubies, based on my work in https://github.com/eregon/ruby-install-builder

To get started, we need a few things to be done by the owners of this repo:

  • Create a release to store all builds, much like https://github.com/eregon/ruby-install-builder/releases/tag/builds-bundler1. The release should be public so everyone can see which Rubies are already available there.
  • For that, we need a tag, I propose all-builds or builds-for-v2. The commit it points can be anything, I'd suggest the initial commit of this repository (58d0881).
  • Create a branch named builder. The commit used for the branch's head doesn't matter, but I would also use the initial commit of this repository (58d0881).

Then I can add a workflow (via a PR) to the builder branch that builds Rubies and add them to that release. We can trigger builds just by pushing/PR a new commit to that branch. Changes on that branch should not directly affect users of this action, so I think it's best to be separate from master (we would not want to trigger it for every commit to master). Having a dedicated branch for this makes it easy to trigger builds manually (by merging a PR to that branch, or pushing to it).

Once that's done, we can start by building the stable releases (also for JRuby and TruffleRuby). That's easy, as shown by https://github.com/eregon/ruby-install-builder/blob/5f9e3c5e756846ee3df7af7883e136d4466fb144/.github/workflows/build.yml which does exactly that. I'll make a PR for that once the 3 items above are done.

Later on, we can then expand to eventually cover all Ruby versions.

As soon as we have some builds on that release, we can start integrating logic from https://github.com/eregon/use-ruby-action to use the prebuilt Rubies.
We'll probably want to maintain an explicit list of available Rubies in the action for nice error messages and being able to handle things like 2.4 => 2.4.9.

We might want at some point to use another tag/release for builds if we change significantly how Rubies are built. We could also reuse the same release, but currently https://github.com/actions/upload-release-asset does not allow to update an existing asset.

There are other concerns about building Rubies, but I'd rather discuss them on a PR to that builder branch to keep this issue focused.

I'm happy to make PRs for getting all this started and working, based on my experience in this area, as long as the feedback cycle is not too slow.

Support for ruby 2.6.5 version

Hi,

My application is using ruby version 2.6.5.
It was working in github actions before but the version 2.6.5 can't be found now.

In the readme of this repository, it says a ruby-version of 2.6 or 2.6.x are equivalent.
However, I need to install 2.6.5 on actions because all of my application gems are bundled with the version.

Thanks,
Justin

Using action with Rails

Guys, I'm trying to using actions with rails application, actually the workflow passing well but the
workflow console not giving me any outputs!!
you can see the attached screens, I want to know exactly what's the best practises to using actions with rails apps

BTW I also used simple example to test the actions and found it also passed without giving me any outputs in the workflow console

name: Greeting from Astm

on: [push, pull_request]

jobs:
  job1:
    name: Build rails app environment
    runs-on: ubuntu-16.04.6
    steps:
    - name: Install the OS
      env:
        MY_VAR: Hi there! My name is
        FIRST_NAME: Mona
        MIDDLE_NAME: The
        LAST_NAME: Octocat
      run: |
        echo $MY_VAR $FIRST_NAME $MIDDLE_NAME $LAST_NAME.

Screen Shot 2019-09-12 at 2 24 19 PM

Screen Shot 2019-09-12 at 2 22 38 PM

Downloading pre-built Ruby Versions at runtime

@bryanmacfarlane

With #42 closed, I thought I'd continue here.

If one views this repo's purpose as accessing pre-built Rubies located in 'hostedtoolcache', then it is functioning as expected.

For quite a while, issues have been posted that imply that what's contained in 'hostedtoolcache' is not meeting users needs.

Given that, and given that GitHub employs several people active in the Ruby community, are there any plans for changing the current setup?

The Ruby community can certainly come up with solutions, but some at point, we/they will have some needs from Actions to make it function reasonably well. An example would be MSYS2 for Windows extension gem CI, and also building Ruby itself. Installing MSYS2 from scratch is time consuming.

If this isn't the palace to discuss this, please suggest where...

setup-ruby failing consistently on macOS

Run actions/setup-ruby@v1
11
sudo ln -sf /Users/runner/hostedtoolcache/Ruby/2.7.0/x64/bin/ruby /usr/bin/ruby
12
ln: /usr/bin/ruby: Operation not permitted
13
(node:1108) UnhandledPromiseRejectionWarning: Error: The process 'sudo' failed with exit code 1
14
    at ExecState._setResult (/Users/runner/runners/2.169.0/work/_actions/actions/setup-ruby/v1/node_modules/@actions/exec/lib/toolrunner.js:547:25)
15
    at ExecState.CheckComplete (/Users/runner/runners/2.169.0/work/_actions/actions/setup-ruby/v1/node_modules/@actions/exec/lib/toolrunner.js:530:18)
16
    at ChildProcess.<anonymous> (/Users/runner/runners/2.169.0/work/_actions/actions/setup-ruby/v1/node_modules/@actions/exec/lib/toolrunner.js:430:27)
17
    at ChildProcess.emit (events.js:210:5)
18
    at maybeClose (internal/child_process.js:1021:16)
19
    at Socket.<anonymous> (internal/child_process.js:430:11)
20
    at Socket.emit (events.js:210:5)
21
    at Pipe.<anonymous> (net.js:659:12)
22
(node:1108) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
23
(node:1108) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

Version 2.6.3 not found error

Is ruby version 2.6.3 not supported anymore by this action ? I'm specifying exact version as follows:

- name: Set up Ruby 2.6
  uses: actions/setup-ruby@v1
  with:
    ruby-version: 2.6.3

And, I'm getting the following error:

Run actions/setup-ruby@v1
  with:
    ruby-version: 2.6.3
##[error]Version 2.6.3 not found
##[error]Node run failed with exit code 1

If I do 2.6 or 2.6.x it gets version 2.6.5. Is there any other way to force the use of the version i want?

Error: Unable to process command '##[add-path]/opt/hostedtoolcache/Ruby/2.6.6/x64/bin' successfully.

I'm currently using actions/[email protected] version.
This morning my workflow failed with the following error:

image

Run actions/[email protected]
with:
ruby-version: 2.6.x
Error: Unable to process command '##[add-path]/opt/hostedtoolcache/Ruby/2.6.6/x64/bin' successfully.
Error: The add-path command is disabled. Please upgrade to using Environment Files or opt into unsecure command execution by setting the ACTIONS_ALLOW_UNSECURE_COMMANDS environment variable to true. For more information see: github.blog/changelog/2020-10-01-github-actions-deprecating-set-env-and-add-path-commands

Mark as unmaintained

Sadly we haven't got the time to maintain this repository as an official GitHub Action. In this case ruby/ruby-setup has become the default go to Action and we use that in our starter workflows.

We'd like to mark this repository as unmaintained and make it clear to users what their expectations should be.

People are of course free to fork this repository and maintain those forks if they like.

To do this we'll:

  • Remove it from the Marketplace (wasn't on the Marketplace)
  • Remove from any official GitHub documentation (not in the documentation)
  • Change the README.md to clearly reflect its new state.
  • Update the README.md to point to other community Actions.
  • Archive this repository, putting it read-only mode. It will continue to work for all existing Action users, but won't receive any updates.

Issue #52, There is a real binary distribution trust issue.

@bryanmacfarlane @ethomson

'There is a real binary distribution trust issue.'

That seems to be the main issue here, and ruby/ruby has never released binaries. Obviously, other languages have, but there's also several copies of OpenSSL binaries on the Windows image because OpenSSL doesn't release binaries. To my knowledge, for some of the builds one cannot even get to the build code or a log of the build behind an https CI system.

So, GH wants 'binary distribution trust', but it doesn't want to host the binaries themselves.

I think there needs to be another solution.

The build system (rbenv/ruby-build) used by use-ruby-action has a few maintainers that are GH staff.

If a repo/org account was started that was more of a 'collective' of people, could it create and host the binary builds? Not part of GH, but 'approved' by GH? Certainly could contain whatever 'due diligence, but if you really want secure' language as needed...

Use recommended release strategy

We should be using the release strategy specified by https://github.com/actions/toolkit/blob/master/docs/action-versioning.md#recommendations

To get there, we need to:

  1. Create a releases/v1 branch and move the v1 tag and future releases there
  2. Warn that we will deprecate the master branch and that you should attach to v1 instead. We will support master in a warned but deprecated state for ~1 month.
  3. Switch the warning to an error on master. Remove node_modules from the master branch. We will stay in this state for ~1 month.
  4. Remove the error on master.

During steps 2 and 3, we need to be extra careful to not check the warning/error into the releases branch.

Support for alternatives implementations: TruffleRuby, JRuby, etc

There are multiple implementations of Ruby (see for example https://www.ruby-lang.org/en/about/).
Ruby library (gem) maintainers like to test against these other Ruby implementations in CI, to make sure their library works on that implementation too.

Should actions/setup-ruby be able to setup those Ruby implementations?
Or should it be a separate repository to setup those Ruby implementations?

I think having it in actions/setup-ruby would be more convenient, as one would be able to reuse the same workflow file for testing both on MRI and e.g. on JRuby and on TruffleRuby:

jobs:
  build:
    runs-on: ubuntu-latest
    strategy:
      matrix:
        ruby: [ '2.6.x', 'jruby-9.2.8.0', 'truffleruby-19.2' ]
    name: Ruby ${{ matrix.ruby }} sample
    steps:
      - uses: actions/checkout@master
      - name: Setup ruby
        uses: actions/setup-ruby@v1
        with:
          ruby-version: ${{ matrix.ruby }}
      - run: ruby hello.rb

I think most alternative Ruby implementations provide their own binaries (while MRI does not), so the setup is usually fairly simple, and usually consists of just downloading + adding to PATH, sometimes with an extra command to run.
For instance for TruffleRuby it's just:

curl -L https://github.com/oracle/truffleruby/releases/download/vm-$VERSION/truffleruby-$VERSION-linux-amd64.tar.gz | tar xz
export PATH="$PWD/truffleruby-$VERSION-linux-amd64/bin:$PATH"
$PWD/truffleruby-$VERSION-linux-amd64/lib/truffle/post_install_hook.sh

Abandoned repo?

I really like this action. I love how simple it makes adding a Ruby to a workflow. I would really love to continue to use it instead of Dockerizing all of the things. However, it seems like this repo is abandoned and not actively maintained.

If it is abandoned, would it possible for GitHub to find some other folx to own it, please? Having first party, top level support for Ruby in Actions feels really important to me.

โค๏ธ

Ruby version ignored

I have the following in my config, but the Ruby version defaults to 2.6.3
Any idea what's wrong?

      - name: Setup Ruby
        uses: actions/[email protected]
        with:
          ruby-version: '2.5.5'

This is the output:

Run actions/[email protected]
2
  with:
3
    ruby-version: 2.5.5
4
    version: >= 2.4
5
sudo ln -sf /opt/hostedtoolcache/Ruby/2.6.3/x64/bin/ruby /usr/bin/ruby
6
##[add-path]/opt/hostedtoolcache/Ruby/2.6.3/x64/bin

UnhandledPromiseRejectionWarning on macOS

https://github.com/ruby/spec/pull/683/checks?check_run_id=202172164

Run actions/setup-ruby@v1
  with:
    ruby-version: 2.5.x
do ln -sf /Users/runner/hostedtoolcache/Ruby/2.5.5/x64/bin/ruby /usr/bin/ruby
##[add-path]/Users/runner/hostedtoolcache/Ruby/2.5.5/x64/bin
ln: /usr/bin/ruby: Operation not permitted
(node:825) UnhandledPromiseRejectionWarning: Error: The process 'sudo' failed with exit code 1
    at ExecState._setResult (/Users/runner/runners/2.157.0/work/_actions/actions/setup-ruby/v1/node_modules/@actions/exec/lib/toolrunner.js:547:25)
    at ExecState.CheckComplete (/Users/runner/runners/2.157.0/work/_actions/actions/setup-ruby/v1/node_modules/@actions/exec/lib/toolrunner.js:530:18)
    at ChildProcess.<anonymous> (/Users/runner/runners/2.157.0/work/_actions/actions/setup-ruby/v1/node_modules/@actions/exec/lib/toolrunner.js:430:27)
    at ChildProcess.emit (events.js:200:13)
    at maybeClose (internal/child_process.js:1021:16)
    at Socket.<anonymous> (internal/child_process.js:430:11)
    at Socket.emit (events.js:200:13)
    at Pipe.<anonymous> (net.js:586:12)
(node:825) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:825) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

It seems the ln -sf fails on macOS. The build still works nevertheless.

Actually, what tool requires /usr/bin/ruby to be the same as ruby in PATH?
AFAIK other CIs and all 3 major Ruby managers do not touch /usr/bin/ruby.
I saw

// Ruby / Gem heavily use the '#!/usr/bin/ruby' to find ruby, so this task needs to
// replace that version of ruby so all the correct version of ruby gets selected
// replace the default

but in my experience there is no such problem with RubyGems (as long as gem is on PATH too alongside ruby, but that should always be the case).

I think if such a workaround is needed, it should be done only in those needed cases, not by setup-ruby, what do you think?

Supporting Ruby 2.6.6 and other security releases

Ruby 2.6.6 was a security release, and came out on 3/31/20 (https://www.ruby-lang.org/en/news/2020/03/31/ruby-2-6-6-released/). It's not yet available in setup-ruby so things like CI jobs can't run Ruby 2.6.6 yet and will output: ##[error]Version 2.6.6 not found. It looks like this kind of lag has been raised as an issue for previous Ruby releases (eg, #8) but I don't see anything on the releases this week.

It seems like one alternative is to swap the job to run in a Ruby container instead of on the runner. Another alternative is to use https://github.com/ruby/setup-ruby, which worked for me as a drop-in replacement and includes 2.6.6.

Thanks!

Error message isn't actionable when ruby version isn't found

When a ruby version isn't found in the image cache, all you get is ##[error]Version 2.6.5 not found. At least in the case of a patch version, it would be good for the error message to recommend the user try specifying only major and minor (e.g. 2.6.x)

Add problem matchers

We should add ruby problem matchers here for nicer output. I can help, you can also take a look at other repos for examples (setup-node in particular has several good examples)

Readline support

I was trying to use actions/setup-ruby in a Rails project and was surprised to see that ruby was installed with no readline support. If you use byebug or any other similar tools, you won't be able to run any commands from your project.

Sorry, you can't use byebug without Readline. To solve this, you need to
rebuild Ruby with Readline support. If using Ubuntu, try sudo apt-get install libreadline-dev and then reinstall your Ruby.

Is there a way to get a ruby version that's compiled with readline support? Or are we forced to use Docker images?

Does not work with self-hosted

When I run on a self-hosted runner I always get an error that ruby was not found,

Preatty sure it has something to do with your note

. Note that this action only uses versions of Ruby already installed in the cache. 

How do I prime that cache?

Support .ruby-version

Many ruby projects include a .ruby-version file in the root directory, containing the version of Ruby needed.

Tools such as rvm, rbenv and chruby all recognise and use this file.

This is not unlike the .nvmrc file often used in Node projects, and the setup-node action has a discussion on potentially using the contents of that file as the node version if no with: argument is specified. (actions/setup-node#32)

I would suggest that setup-ruby might consider a similar approach, where if no explicit ruby version is given, look for a .ruby-version file and use the version contained within.

Rename default branch

๐Ÿ‘‹ This issue is to track the move over to using main as the default branch for this repo. Weโ€™d love your team's help in completing this transition.

Do not remove your old default branch, customers are going to be using it. We will be sending messages out about these changes, but if you want to message in your repository, that's fine as well.

  • Create a main branch.
  • You might need to rebase any pull requests you want to merge before changing the default branch.
  • Change the default branch in settings to main.
  • Update any documentation in this repo to refer to the new branch name, although using the version tag is still preferred.
  • Check that this Action works correctly for users who have a repository with a custom default branch name.
  • Close this issue and celebrate ๐ŸŽ‰

We are aiming to complete this work by July 17th August 28th.

Should we deprecate this action?

In actions/starter-workflows#448 (comment), @chrispat said:

I don't see a reason to have two different workflows and I also expect that we will deprecate actions/setup-ruby.

I think this is a good idea.
Currently I noticed several cases where people are confused between ruby/setup-ruby and actions/setup-ruby (this action).
For instance ruby/setup-ruby#52 (comment).

As a disclaimer I'm the maintainer of ruby/setup-ruby.
I see ruby/setup-ruby as a superset of actions/setup-ruby:

  • Access to essentially all Ruby versions, including alternative implementations, development builds, etc. That's 59 versions vs 3-4 for this actions/setup-ruby. Many Ruby projects or projects using Ruby want to pin to a specific teeny version.
  • Automatically install an appropriate Bundler (opt-out)
  • Automated caching of bundle install (opt-in)
  • Maintained actively
  • ruby/setup-ruby is the Ruby starter workflow

So, do you agree we should deprecate this action?
If so, how would the deprecation be implemented in practice?

Error on macOS

I'm trying to setup ruby on a macOS workflow:

- uses: actions/setup-ruby@v1
        with:
          ruby-version: '2.7'

which gives this error:

 Run actions/setup-ruby@v1 1s
(node:992) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
Run actions/setup-ruby@v1
sudo ln -sf /Users/runner/hostedtoolcache/Ruby/2.7.1/x64/bin/ruby /usr/bin/ruby
ln: /usr/bin/ruby: Operation not permitted
(node:992) UnhandledPromiseRejectionWarning: Error: The process 'sudo' failed with exit code 1
    at ExecState._setResult (/Users/runner/work/_actions/actions/setup-ruby/v1/node_modules/@actions/exec/lib/toolrunner.js:547:25)
    at ExecState.CheckComplete (/Users/runner/work/_actions/actions/setup-ruby/v1/node_modules/@actions/exec/lib/toolrunner.js:530:18)
    at ChildProcess.<anonymous> (/Users/runner/work/_actions/actions/setup-ruby/v1/node_modules/@actions/exec/lib/toolrunner.js:430:27)
    at ChildProcess.emit (events.js:210:5)
    at maybeClose (internal/child_process.js:1021:16)
    at Socket.<anonymous> (internal/child_process.js:430:11)
    at Socket.emit (events.js:210:5)
    at Pipe.<anonymous> (net.js:659:12)
[...]

Do I need anything else to make this work?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.