Compare commits
17 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
18c61abf68 | ||
|
|
c5dddd605c | ||
|
|
1ecad9811f | ||
|
|
2f0115cdb3 | ||
|
|
9562cfc737 | ||
|
|
4ce0939221 | ||
|
|
1de6d4c9a8 | ||
|
|
3656ce6e59 | ||
|
|
af7e0f8d35 | ||
|
|
2413b984fb | ||
|
|
b4ef174b15 | ||
|
|
d0b84d3722 | ||
|
|
0662c7a33d | ||
|
|
573594eefe | ||
|
|
d838e152a7 | ||
|
|
50f3cc9f0b | ||
|
|
8ad38c1114 |
90
.gitignore
vendored
90
.gitignore
vendored
@@ -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/
|
||||
|
||||
53
README.md
53
README.md
@@ -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)
|
||||
|
||||
@@ -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'
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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
6
package-lock.json
generated
@@ -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",
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user