Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c6c44b217a | ||
|
|
8dd8957526 | ||
|
|
15a6f141d8 | ||
|
|
348966bbc4 |
13
README.md
13
README.md
@@ -1,5 +1,9 @@
|
|||||||
# setup-ruby
|
# setup-ruby
|
||||||
|
|
||||||
|
<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>
|
||||||
|
|
||||||
This action sets up a ruby environment for use in actions by:
|
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.
|
- 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.
|
||||||
@@ -15,7 +19,7 @@ steps:
|
|||||||
- uses: actions/checkout@master
|
- uses: actions/checkout@master
|
||||||
- uses: actions/setup-ruby@v1
|
- uses: actions/setup-ruby@v1
|
||||||
with:
|
with:
|
||||||
version: 2.x // Version range or exact version of a Ruby version to use, using semvers version range syntax.
|
ruby-version: '2.x' // Version range or exact version of a Ruby version to use, using semvers version range syntax.
|
||||||
- run: ruby hello.rb
|
- run: ruby hello.rb
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -23,17 +27,18 @@ Matrix Testing:
|
|||||||
```yaml
|
```yaml
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
|
runs-on: ubuntu-16.04
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
ruby: [ 2.x, 3.x ]
|
ruby: [ '2.x', '3.x' ]
|
||||||
name: Ruby ${{ matrix.ruby }} sample
|
name: Ruby ${{ matrix.ruby }} sample
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@master
|
- uses: actions/checkout@master
|
||||||
- name: Setup ruby
|
- name: Setup ruby
|
||||||
uses: actions/setup-ruby@v1
|
uses: actions/setup-ruby@v1
|
||||||
with:
|
with:
|
||||||
version: ${{ matrix.ruby }}
|
ruby-version: ${{ matrix.ruby }}
|
||||||
architecture: x64
|
architecture: 'x64'
|
||||||
- run: ruby hello.rb
|
- run: ruby hello.rb
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|||||||
@@ -1,11 +1,13 @@
|
|||||||
name: 'Setup Ruby for use with actions'
|
name: 'Setup Ruby environment'
|
||||||
description: 'Setup a Ruby environment and add it to the PATH'
|
description: 'Setup a Ruby environment and add it to the PATH'
|
||||||
author: 'GitHub'
|
author: 'GitHub'
|
||||||
inputs:
|
inputs:
|
||||||
version:
|
ruby-version:
|
||||||
description: 'Version range or exact version of a Ruby version to use.'
|
description: 'Version range or exact version of a Ruby version to use.'
|
||||||
default: '>= 2.4'
|
default: '>= 2.4'
|
||||||
|
# Deprecated option, do not use. Will not be supported after October 1, 2019
|
||||||
|
version:
|
||||||
|
description: 'Deprecated. Use ruby-version instead. Will not be supported after October 1, 2019'
|
||||||
runs:
|
runs:
|
||||||
using: 'node12'
|
using: 'node12'
|
||||||
main: 'lib/setup-ruby.js'
|
main: 'lib/setup-ruby.js'
|
||||||
|
|||||||
@@ -20,7 +20,10 @@ const installer_1 = require("./installer");
|
|||||||
function run() {
|
function run() {
|
||||||
return __awaiter(this, void 0, void 0, function* () {
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
try {
|
try {
|
||||||
const version = core.getInput('version');
|
let version = core.getInput('version');
|
||||||
|
if (!version) {
|
||||||
|
version = core.getInput('ruby-version');
|
||||||
|
}
|
||||||
yield installer_1.findRubyVersion(version);
|
yield installer_1.findRubyVersion(version);
|
||||||
}
|
}
|
||||||
catch (error) {
|
catch (error) {
|
||||||
|
|||||||
@@ -3,7 +3,10 @@ import {findRubyVersion} from './installer';
|
|||||||
|
|
||||||
async function run() {
|
async function run() {
|
||||||
try {
|
try {
|
||||||
const version = core.getInput('version');
|
let version = core.getInput('version');
|
||||||
|
if (!version) {
|
||||||
|
version = core.getInput('ruby-version');
|
||||||
|
}
|
||||||
await findRubyVersion(version);
|
await findRubyVersion(version);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
core.setFailed(error.message);
|
core.setFailed(error.message);
|
||||||
|
|||||||
Reference in New Issue
Block a user