17 Commits

Author SHA1 Message Date
Bryan MacFarlane
18c61abf68 Merge pull request #27 from eregon/patch-1
Some checks failed
Main workflow / Run (ubuntu-latest) (push) Has been cancelled
Main workflow / Run (windows-latest) (push) Has been cancelled
Update README
2020-01-17 09:29:04 -05:00
Bryan MacFarlane
c5dddd605c update contributors guide 2020-01-12 10:08:22 -05:00
Bryan MacFarlane
1ecad9811f update contributors guide 2020-01-12 10:05:14 -05:00
Eileen M. Uchitelle
2f0115cdb3 Merge pull request #19 from actions/gitignore
Update .gitignore
2020-01-09 14:06:46 -05:00
Eileen M. Uchitelle
9562cfc737 Merge pull request #29 from eregon/no-symlink-usr-bin
Only add ruby in $PATH, do not overwrite /usr/bin/ruby
2020-01-09 14:05:44 -05:00
Eileen M. Uchitelle
4ce0939221 Merge pull request #43 from actions/dependabot/npm_and_yarn/handlebars-4.5.3
Bump handlebars from 4.1.2 to 4.5.3
2020-01-09 13:57:22 -05:00
Bryan MacFarlane
1de6d4c9a8 Merge pull request #47 from joshmgross/patch-1
Add notes on caching to Readme
2020-01-07 15:43:04 -05:00
Josh Gross
3656ce6e59 Add notes on caching to Readme 2020-01-07 15:03:45 -05:00
Bryan MacFarlane
af7e0f8d35 Merge pull request #34 from alanvardy/patch-1
Add Ruby on Rails test example
2020-01-07 14:19:08 -05:00
dependabot[bot]
2413b984fb Bump handlebars from 4.1.2 to 4.5.3
Bumps [handlebars](https://github.com/wycats/handlebars.js) from 4.1.2 to 4.5.3.
- [Release notes](https://github.com/wycats/handlebars.js/releases)
- [Changelog](https://github.com/wycats/handlebars.js/blob/master/release-notes.md)
- [Commits](https://github.com/wycats/handlebars.js/compare/v4.1.2...v4.5.3)

Signed-off-by: dependabot[bot] <support@github.com>
2019-12-29 19:05:40 +00:00
Mike Coutermarsh
b4ef174b15 Merge pull request #38 from actions/ethomson/update_description
Update description
2019-11-12 08:21:13 -08:00
Edward Thomson
d0b84d3722 Update description 2019-11-08 16:43:42 +00:00
Alan Vardy
0662c7a33d Add Ruby on Rails test example 2019-10-02 15:29:57 -06:00
Benoit Daloze
573594eefe Only add ruby in $PATH, do not overwrite /usr/bin/ruby
* Fixes https://github.com/actions/setup-ruby/issues/18
* The symlink never worked on macOS, and there was a missing `await`.
* No tool should hardcode `/usr/bin/ruby`, but instead executables
  should use `#!/usr/bin/env ruby`.
* If a specific tool needs the symlink, then it can of course be
  added as part of the steps of that CI.
2019-09-21 22:49:48 +02:00
Benoit Daloze
d838e152a7 Update README
* Use more realistic versions.
* `architecture` is not used for this action.
* Remove redundant `name:` in example.
2019-09-21 19:12:14 +02:00
Danny McCormick
50f3cc9f0b Deprecate version
Some checks failed
Main workflow / Run (ubuntu-latest) (push) Has been cancelled
Main workflow / Run (windows-latest) (push) Has been cancelled
2019-09-12 10:37:13 -04:00
Danny McCormick
8ad38c1114 Update .gitignore 2019-08-26 10:58:02 -04:00
7 changed files with 152 additions and 30 deletions

90
.gitignore vendored
View File

@@ -1,2 +1,92 @@
# Explicitly not ignoring node_modules so that they are included in package downloaded by runner
!node_modules/
__tests__/runner/*
# Rest of the file pulled from https://github.com/github/gitignore/blob/master/Node.gitignore
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
lerna-debug.log*
# Diagnostic reports (https://nodejs.org/api/report.html)
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json
# Runtime data
pids
*.pid
*.seed
*.pid.lock
# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov
# Coverage directory used by tools like istanbul
coverage
*.lcov
# nyc test coverage
.nyc_output
# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
.grunt
# Bower dependency directory (https://bower.io/)
bower_components
# node-waf configuration
.lock-wscript
# Compiled binary addons (https://nodejs.org/api/addons.html)
build/Release
# Dependency directories
jspm_packages/
# TypeScript v1 declaration files
typings/
# TypeScript cache
*.tsbuildinfo
# Optional npm cache directory
.npm
# Optional eslint cache
.eslintcache
# Optional REPL history
.node_repl_history
# Output of 'npm pack'
*.tgz
# Yarn Integrity file
.yarn-integrity
# dotenv environment variables file
.env
.env.test
# parcel-bundler cache (https://parceljs.org/)
.cache
# next.js build output
.next
# nuxt.js build output
.nuxt
# vuepress build output
.vuepress/dist
# Serverless directories
.serverless/
# FuseBox cache
.fusebox/
# DynamoDB Local files
.dynamodb/

View File

@@ -19,7 +19,7 @@ steps:
- uses: actions/checkout@master
- uses: actions/setup-ruby@v1
with:
ruby-version: '2.x' # Version range or exact version of a Ruby version to use, using semvers version range syntax.
ruby-version: '2.6.x' # Version range or exact version of a Ruby version to use, using semvers version range syntax.
- run: ruby hello.rb
```
@@ -30,18 +30,61 @@ jobs:
runs-on: ubuntu-16.04
strategy:
matrix:
ruby: [ '2.x', '3.x' ]
ruby: [ '2.5.x', '2.6.x' ]
name: Ruby ${{ matrix.ruby }} sample
steps:
- uses: actions/checkout@master
- name: Setup ruby
uses: actions/setup-ruby@v1
- uses: actions/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
architecture: 'x64'
- run: ruby hello.rb
```
Ruby on Rails Testing:
```yaml
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@v1
- name: Set up Ruby 2.6
uses: actions/setup-ruby@v1
with:
ruby-version: 2.6.x
- 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](https://github.com/actions/cache) and the [Ruby Gem cache example](https://github.com/actions/cache/blob/master/examples.md#ruby---gem).
# License
The scripts and documentation in this project are released under the [MIT License](LICENSE)

View File

@@ -1,5 +1,5 @@
name: 'Setup Ruby environment'
description: 'Setup a Ruby environment and add it to the PATH'
name: 'Setup Ruby'
description: 'Set up a specific version of Ruby and add the command-line tools to the PATH'
author: 'GitHub'
inputs:
ruby-version:
@@ -8,6 +8,7 @@ inputs:
# 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'
deprecationMessage: 'The version property will not be supported after October 1, 2019. Use ruby-version instead'
runs:
using: 'node12'
main: 'lib/setup-ruby.js'

View File

@@ -1,5 +1,13 @@
# Contributors
### Changes
The process is consistent for internal and external contributions. The only difference is external contributions PRs come from a fork.
For trivial bug fixes, create an issue to discuss and then a PR can follow referencing the issue.
For enhancements and new features, create an enhancment issue for discuss followed by a [design proposal known as an ADR](https://github.com/actions/setup-ruby/blob/adrs/adrs/README.md). This allows everyone to get to consensus before coding and also serves as a record going forward.
### Checkin
- Do checkin source (src)

View File

@@ -16,10 +16,8 @@ var __importStar = (this && this.__importStar) || function (mod) {
};
Object.defineProperty(exports, "__esModule", { value: true });
const core = __importStar(require("@actions/core"));
const exec = __importStar(require("@actions/exec"));
const tc = __importStar(require("@actions/tool-cache"));
const path = __importStar(require("path"));
const IS_WINDOWS = process.platform === 'win32';
function findRubyVersion(version) {
return __awaiter(this, void 0, void 0, function* () {
const installDir = tc.find('Ruby', version);
@@ -27,13 +25,6 @@ function findRubyVersion(version) {
throw new Error(`Version ${version} not found`);
}
const toolPath = path.join(installDir, 'bin');
if (!IS_WINDOWS) {
// 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
const dest = '/usr/bin/ruby';
exec.exec('sudo ln', ['-sf', path.join(toolPath, 'ruby'), dest]); // replace any existing
}
core.addPath(toolPath);
});
}

6
package-lock.json generated
View File

@@ -2338,9 +2338,9 @@
"dev": true
},
"handlebars": {
"version": "4.1.2",
"resolved": "https://registry.npmjs.org/handlebars/-/handlebars-4.1.2.tgz",
"integrity": "sha512-nvfrjqvt9xQ8Z/w0ijewdD/vvWDTOweBUm96NTr66Wfvo1mJenBLwcYmPs3TIBP5ruzYGD7Hx/DaM9RmhroGPw==",
"version": "4.5.3",
"resolved": "https://registry.npmjs.org/handlebars/-/handlebars-4.5.3.tgz",
"integrity": "sha512-3yPecJoJHK/4c6aZhSvxOyG4vJKDshV36VHp0iVCDVh7o9w2vwi3NSnL2MMPj3YdduqaBcu7cGbggJQM0br9xA==",
"dev": true,
"requires": {
"neo-async": "^2.6.0",

View File

@@ -1,10 +1,7 @@
import * as core from '@actions/core';
import * as exec from '@actions/exec';
import * as tc from '@actions/tool-cache';
import * as path from 'path';
const IS_WINDOWS = process.platform === 'win32';
export async function findRubyVersion(version: string) {
const installDir: string | null = tc.find('Ruby', version);
@@ -14,13 +11,5 @@ export async function findRubyVersion(version: string) {
const toolPath: string = path.join(installDir, 'bin');
if (!IS_WINDOWS) {
// 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
const dest: string = '/usr/bin/ruby';
exec.exec('sudo ln', ['-sf', path.join(toolPath, 'ruby'), dest]); // replace any existing
}
core.addPath(toolPath);
}