2019-07-17 11:01:48 -04:00
# setup-ruby
2019-08-12 15:13:09 -04:00
< p align = "left" >
< a href = "https://github.com/actions/setup-ruby" > < img alt = "GitHub Actions status" src = "https://github.com/actions/setup-ruby/workflows/Main%20workflow/badge.svg" > < / a >
< / p >
2019-07-17 11:01:48 -04:00
This action sets up a ruby environment for use in actions by:
- optionally installing a version of ruby and adding to PATH. Note that this action only uses versions of Ruby already installed in the cache. The action will fail if no matching versions are found.
- registering problem matchers for error output
# Usage
See [action.yml ](action.yml )
Basic:
```yaml
2019-07-25 21:26:06 -04:00
steps:
2019-07-23 15:46:24 -04:00
- uses: actions/checkout@master
2019-08-01 09:32:52 -04:00
- uses: actions/setup-ruby@v1
2019-07-17 11:01:48 -04:00
with:
2019-08-16 10:19:30 -04:00
ruby-version: '2.x' # Version range or exact version of a Ruby version to use, using semvers version range syntax.
2019-07-17 11:01:48 -04:00
- run: ruby hello.rb
```
Matrix Testing:
```yaml
jobs:
build:
2019-08-01 11:06:53 -04:00
runs-on: ubuntu-16.04
2019-07-17 11:01:48 -04:00
strategy:
matrix:
2019-08-01 11:06:53 -04:00
ruby: [ '2.x', '3.x' ]
2019-07-17 11:01:48 -04:00
name: Ruby ${{ matrix.ruby }} sample
2019-07-25 21:26:06 -04:00
steps:
2019-07-23 15:46:24 -04:00
- uses: actions/checkout@master
2019-07-17 11:01:48 -04:00
- name: Setup ruby
2019-08-01 09:32:52 -04:00
uses: actions/setup-ruby@v1
2019-07-17 11:01:48 -04:00
with:
2019-08-13 16:29:23 -04:00
ruby-version: ${{ matrix.ruby }}
2019-08-01 11:06:53 -04:00
architecture: 'x64'
2019-07-17 11:01:48 -04:00
- run: ruby hello.rb
```
2019-06-26 14:22:50 -04:00
2019-06-26 14:28:48 -04:00
# License
The scripts and documentation in this project are released under the [MIT License ](LICENSE )
# Contributions
2019-06-27 14:31:32 -04:00
Contributions are welcome! See [Contributor's Guide ](docs/contributors.md )