DO NOT USE THIS ACTION
ruby/setup-ruby provides everything that this action has provided.
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.
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
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.
The scripts and documentation in this project are released under the MIT License