Skip to content
This repository has been archived by the owner on May 22, 2024. It is now read-only.
/ setup-rbenv Public archive
generated from actions/typescript-action

Set up your GitHub Actions workflow with rbenv

License

Notifications You must be signed in to change notification settings

masa-iwasaki/setup-rbenv

Use this GitHub action with your project
Add this Action to an existing workflow or create a new one
View on Marketplace

Repository files navigation

DO NOT USE THIS ACTION

ruby/setup-ruby provides everything that this action has provided.

setup-rbenv

Setup Ruby by rbenv on Ubuntu 18.04 / 16.04 virtual environments, not using tool-cache provided by GitHub to catch up the latest versions of Ruby.

Usage

You need to initialize rbenv by dispatching eval "$(rbenv init -)" in each step before you run Ruby.

steps:
- uses: actions/checkout@master
- uses: masa-iwasaki/setup-rbenv@v1
- name: Install Ruby
  run: |
    eval "$(rbenv init -)"
    rbenv install -s `cat .ruby-version` # or specify the version you want

- name: Run bundler
  run: |
    eval "$(rbenv init -)"
    bundle install --path vendor/bundle

Cache

By using actions/cache, you can keep your rubies in your cache.

steps:
- uses: actions/checkout@master
- uses: masa-iwasaki/setup-rbenv@v1

- name: Cache RBENV_ROOT
  uses: actions/cache@v1
  id: cache_rbenv
  with:
    path: /home/runner/.rbenv
    key: ${{ runner.os }}-rbenv-${{ hashFiles('**/.ruby-version') }}
    restore-keys: |
      {{ runner.os }}-rbenv-

- name: Install Ruby
  run: |
    eval "$(rbenv init -)"
    rbenv install -s `cat .ruby-version`

You don't need to check cache hit because -s option for rbenv install does the job. You need to be aware of cache limits if you want to keep multiple rubies.

License

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