Compare commits

...
9 Commits
Author SHA1 Message Date
Benoit Daloze 48481806ad Update to latest builds fixing "Insecure world writable dir" warnings
* Update to Rubinius 4.14 which fixes some segfaults.
2020-02-02 16:33:46 +01:00
Benoit Daloze 623e527949 Rename generate script 2020-02-02 13:23:31 +01:00
Benoit Daloze c933cecfdc Follow ruby-install-builder => ruby-builder repository rename 2020-02-02 13:21:37 +01:00
Benoit Daloze 7c15ff8590 Add info about the -head builders 2020-02-01 21:21:26 +01:00
Benoit Daloze 58366f2203 Reduce the test matrix as it's getting too large
* It was 40 checks and a lot of queuing on macOS.
* Version parsing is stable and can be tested more directly.
* 2.6.5 was tested twice: .ruby-version and explicitly.
2020-02-01 18:31:35 +01:00
Benoit Daloze f5483241db Add support for ruby-head 2020-02-01 18:22:53 +01:00
Benoit Daloze 0331c8b821 Add support for truffleruby-head 2020-02-01 15:17:12 +01:00
Benoit Daloze 818f4eeb16 The :required key is required is action.yml
* See https://help.github.com/en/actions/automating-your-workflow-with-github-actions/metadata-syntax-for-github-actions
2020-02-01 13:41:57 +01:00
Benoit Daloze 052cbd8ee4 Test bundle exec too 2020-01-30 23:24:13 +01:00
14 changed files with 3538 additions and 141 deletions
+8 -5
View File
@@ -14,10 +14,12 @@ jobs:
matrix: matrix:
os: [ ubuntu-16.04, ubuntu-18.04, macos-latest, windows-latest ] os: [ ubuntu-16.04, ubuntu-18.04, macos-latest, windows-latest ]
# Use various version syntaxes here for testing # Use various version syntaxes here for testing
ruby: [ .ruby-version, 2.3, ruby-2.4, 2.5, ruby-2.6.5, 2.7.0, jruby, truffleruby, rubinius ] ruby: [ .ruby-version, 2.3, 2.7.0, ruby-head, jruby, truffleruby, truffleruby-head, rubinius ]
exclude: exclude:
- os: windows-latest - os: windows-latest
ruby: truffleruby ruby: truffleruby
- os: windows-latest
ruby: truffleruby-head
- os: ubuntu-16.04 - os: ubuntu-16.04
ruby: rubinius ruby: rubinius
- os: macos-latest - os: macos-latest
@@ -33,16 +35,17 @@ jobs:
- run: ruby --version - run: ruby --version
- run: ridk version - run: ridk version
if: matrix.os == 'windows-latest' && !startsWith(matrix.ruby, '2.3') if: matrix.os == 'windows-latest' && !startsWith(matrix.ruby, '2.3')
- name: Subprocess test
run: ruby test_subprocess.rb
- name: OpenSSL version - name: OpenSSL version
run: ruby -ropenssl -e 'puts OpenSSL::OPENSSL_LIBRARY_VERSION' run: ruby -ropenssl -e 'puts OpenSSL::OPENSSL_LIBRARY_VERSION'
- name: OpenSSL test - name: OpenSSL test
run: ruby -ropen-uri -e 'puts open(%{https://rubygems.org/}) { |f| f.read(1024) }' run: ruby -ropen-uri -e 'puts open(%{https://rubygems.org/}) { |f| f.read(1024) }'
- name: C extension test - name: C extension test
run: gem install json:2.2.0 --no-document run: gem install json:2.2.0 --no-document
- name: Bundler version - run: bundle --version
run: bundle --version - run: bundle install
- name: Bundler test - run: bundle exec rake --version
run: bundle install
lint: lint:
runs-on: ubuntu-latest runs-on: ubuntu-latest
+1
View File
@@ -1,5 +1,6 @@
# Used for testing # Used for testing
source 'https://rubygems.org' source 'https://rubygems.org'
gem "rake"
gem "path" gem "path"
gem "json", "2.2.0" gem "json", "2.2.0"
+6 -5
View File
@@ -11,10 +11,10 @@ This action currently supports these versions of MRI, JRuby and TruffleRuby:
| Interpreter | Versions | | Interpreter | Versions |
| ----------- | -------- | | ----------- | -------- |
| Ruby | 2.3.0 - 2.3.8, 2.4.0 - 2.4.9, 2.5.0 - 2.5.7, 2.6.0 - 2.6.5, 2.7.0 | | Ruby | 2.3.0 - 2.3.8, 2.4.0 - 2.4.9, 2.5.0 - 2.5.7, 2.6.0 - 2.6.5, 2.7.0, head |
| JRuby | 9.2.9.0 | | JRuby | 9.2.9.0 |
| TruffleRuby | 19.3.0, 19.3.1 | | TruffleRuby | 19.3.0, 19.3.1, head |
| Rubinius | 4.13 | | Rubinius | 4.14 |
Note that Ruby 2.3 and the OpenSSL version it needs (1.0.2) are both end-of-life, Note that Ruby 2.3 and the OpenSSL version it needs (1.0.2) are both end-of-life,
which means Ruby 2.3 is unmaintained and considered insecure. which means Ruby 2.3 is unmaintained and considered insecure.
@@ -32,9 +32,10 @@ The action works for all [GitHub-hosted runners](https://help.github.com/en/acti
Rubinius is only available on `ubuntu-latest`. Rubinius is only available on `ubuntu-latest`.
The prebuilt rubies are generated by [eregon/ruby-install-builder](https://github.com/eregon/ruby-install-builder) The prebuilt releases are generated by [ruby-builder](https://github.com/eregon/ruby-builder)
and on Windows by [RubyInstaller2](https://github.com/oneclick/rubyinstaller2). and on Windows by [RubyInstaller2](https://github.com/oneclick/rubyinstaller2).
The full list of available Ruby versions can be seen in [ruby-install-builder-versions.js](ruby-install-builder-versions.js) `ruby-head` is generated by [ruby-dev-builder](https://github.com/eregon/ruby-dev-builder) and `truffleruby-head` is generated by [truffleruby-dev-builder](https://github.com/eregon/truffleruby-dev-builder).
The full list of available Ruby versions can be seen in [ruby-builder-versions.js](ruby-builder-versions.js)
for Ubuntu and macOS and in [windows-versions.js](windows-versions.js) for Windows. for Ubuntu and macOS and in [windows-versions.js](windows-versions.js) for Windows.
## Usage ## Usage
+1
View File
@@ -7,6 +7,7 @@ branding:
inputs: inputs:
ruby-version: ruby-version:
description: 'Engine and version to use, see the syntax in the README. Reads from .ruby-version if unset.' description: 'Engine and version to use, see the syntax in the README. Reads from .ruby-version if unset.'
required: false
default: '.ruby-version' default: '.ruby-version'
outputs: outputs:
ruby-prefix: ruby-prefix:
Generated Vendored
+3412 -86
View File
File diff suppressed because it is too large Load Diff
@@ -23,5 +23,7 @@ versions = entries.select { |entry|
[version, entry[:href]] [version, entry[:href]]
}.to_h }.to_h
versions['head'] = 'https://github.com/oneclick/rubyinstaller2/releases/download/rubyinstaller-head/rubyinstaller-head-x64.7z'
js = "export const versions = #{JSON.pretty_generate(versions)}\n" js = "export const versions = #{JSON.pretty_generate(versions)}\n"
File.write 'windows-versions.js', js File.write 'windows-versions.js', js
+2 -2
View File
@@ -11,7 +11,7 @@ async function run() {
if (platform === 'windows-latest' && engine !== 'jruby') { if (platform === 'windows-latest' && engine !== 'jruby') {
installer = require('./windows') installer = require('./windows')
} else { } else {
installer = require('./ruby-install-builder') installer = require('./ruby-builder')
} }
const engineVersions = installer.getAvailableVersions(platform, engine) const engineVersions = installer.getAvailableVersions(platform, engine)
@@ -51,7 +51,7 @@ function validateRubyEngineAndVersion(platform, engineVersions, engine, version)
if (!engineVersions.includes(version)) { if (!engineVersions.includes(version)) {
const latestToFirstVersion = engineVersions.slice().reverse() const latestToFirstVersion = engineVersions.slice().reverse()
const found = latestToFirstVersion.find(v => v.startsWith(version)) const found = latestToFirstVersion.find(v => v !== 'head' && v.startsWith(version))
if (found) { if (found) {
version = found version = found
} else { } else {
+2 -1
View File
@@ -26,7 +26,8 @@
"@actions/core": "^1.1.1", "@actions/core": "^1.1.1",
"@actions/exec": "^1.0.1", "@actions/exec": "^1.0.1",
"@actions/io": "^1.0.1", "@actions/io": "^1.0.1",
"@actions/tool-cache": "^1.1.2" "@actions/tool-cache": "^1.1.2",
"axios": "^0.19.0"
}, },
"devDependencies": { "devDependencies": {
"@zeit/ncc": "^0.20.5", "@zeit/ncc": "^0.20.5",
@@ -5,19 +5,21 @@ export function getVersions(platform) {
"2.4.0", "2.4.1", "2.4.2", "2.4.3", "2.4.4", "2.4.5", "2.4.6", "2.4.7", "2.4.9", "2.4.0", "2.4.1", "2.4.2", "2.4.3", "2.4.4", "2.4.5", "2.4.6", "2.4.7", "2.4.9",
"2.5.0", "2.5.1", "2.5.2", "2.5.3", "2.5.4", "2.5.5", "2.5.6", "2.5.7", "2.5.0", "2.5.1", "2.5.2", "2.5.3", "2.5.4", "2.5.5", "2.5.6", "2.5.7",
"2.6.0", "2.6.1", "2.6.2", "2.6.3", "2.6.4", "2.6.5", "2.6.0", "2.6.1", "2.6.2", "2.6.3", "2.6.4", "2.6.5",
"2.7.0" "2.7.0",
"head"
], ],
"jruby": [ "jruby": [
"9.2.9.0" "9.2.9.0"
], ],
"truffleruby": [ "truffleruby": [
"19.3.0", "19.3.1" "19.3.0", "19.3.1",
"head"
] ]
} }
if (platform === 'ubuntu-18.04') { if (platform === 'ubuntu-18.04') {
versions['rubinius'] = [ versions['rubinius'] = [
"4.13" "4.14"
] ]
} }
+57
View File
@@ -0,0 +1,57 @@
const os = require('os')
const path = require('path')
const core = require('@actions/core')
const io = require('@actions/io')
const tc = require('@actions/tool-cache')
const rubyBuilderVersions = require('./ruby-builder-versions')
const axios = require('axios')
const builderReleaseTag = 'builds-no-warn'
const releasesURL = 'https://github.com/eregon/ruby-builder/releases'
export function getAvailableVersions(platform, engine) {
return rubyBuilderVersions.getVersions(platform)[engine]
}
export async function install(platform, ruby) {
const rubyPrefix = await downloadAndExtract(platform, ruby)
core.addPath(path.join(rubyPrefix, 'bin'))
if (ruby.startsWith('rubinius')) {
core.addPath(path.join(rubyPrefix, 'gems', 'bin'))
}
return rubyPrefix
}
async function downloadAndExtract(platform, ruby) {
const rubiesDir = path.join(os.homedir(), '.rubies')
await io.mkdirP(rubiesDir)
const url = await getDownloadURL(platform, ruby)
console.log(url)
const downloadPath = await tc.downloadTool(url)
await tc.extractTar(downloadPath, rubiesDir)
return path.join(rubiesDir, ruby)
}
async function getDownloadURL(platform, ruby) {
if (ruby.endsWith('-head')) {
return getLatestHeadBuildURL(platform, ruby)
} else {
return `${releasesURL}/download/${builderReleaseTag}/${ruby}-${platform}.tar.gz`
}
}
async function getLatestHeadBuildURL(platform, ruby) {
const engine = ruby.split('-')[0]
const repository = `eregon/${engine}-dev-builder`
const metadataURL = `https://raw.githubusercontent.com/${repository}/metadata/latest_build.tag`
const releasesURL = `https://github.com/${repository}/releases/download`
const response = await axios.get(metadataURL)
const tag = response.data.trim()
return `${releasesURL}/${tag}/${ruby}-${platform}.tar.gz`
}
-37
View File
@@ -1,37 +0,0 @@
const os = require('os')
const path = require('path')
const core = require('@actions/core')
const io = require('@actions/io')
const tc = require('@actions/tool-cache')
const rubyBuilderVersions = require('./ruby-install-builder-versions')
const builderReleaseTag = 'builds-newer-openssl'
const releasesURL = 'https://github.com/eregon/ruby-install-builder/releases'
export function getAvailableVersions(platform, engine) {
return rubyBuilderVersions.getVersions(platform)[engine]
}
export async function install(platform, ruby) {
const rubyPrefix = await downloadAndExtract(platform, ruby)
core.addPath(path.join(rubyPrefix, 'bin'))
if (ruby.startsWith('rubinius')) {
core.addPath(path.join(rubyPrefix, 'gems', 'bin'))
}
return rubyPrefix
}
async function downloadAndExtract(platform, ruby) {
const rubiesDir = path.join(os.homedir(), '.rubies')
await io.mkdirP(rubiesDir)
const url = `${releasesURL}/download/${builderReleaseTag}/${ruby}-${platform}.tar.gz`
console.log(url)
const downloadPath = await tc.downloadTool(url)
await tc.extractTar(downloadPath, rubiesDir)
return path.join(rubiesDir, ruby)
}
+13
View File
@@ -0,0 +1,13 @@
require 'rbconfig'
require 'stringio'
puts "CPPFLAGS: #{RbConfig::CONFIG["CPPFLAGS"]}"
$stderr = StringIO.new
begin
system RbConfig.ruby, "-e", "p :OK"
out = $stderr.string
ensure
$stderr = STDERR
end
abort out unless out.empty?
+2 -1
View File
@@ -22,5 +22,6 @@ export const versions = {
"2.6.3": "https://github.com/oneclick/rubyinstaller2/releases/download/RubyInstaller-2.6.3-1/rubyinstaller-2.6.3-1-x64.7z", "2.6.3": "https://github.com/oneclick/rubyinstaller2/releases/download/RubyInstaller-2.6.3-1/rubyinstaller-2.6.3-1-x64.7z",
"2.6.4": "https://github.com/oneclick/rubyinstaller2/releases/download/RubyInstaller-2.6.4-1/rubyinstaller-2.6.4-1-x64.7z", "2.6.4": "https://github.com/oneclick/rubyinstaller2/releases/download/RubyInstaller-2.6.4-1/rubyinstaller-2.6.4-1-x64.7z",
"2.6.5": "https://github.com/oneclick/rubyinstaller2/releases/download/RubyInstaller-2.6.5-1/rubyinstaller-2.6.5-1-x64.7z", "2.6.5": "https://github.com/oneclick/rubyinstaller2/releases/download/RubyInstaller-2.6.5-1/rubyinstaller-2.6.5-1-x64.7z",
"2.7.0": "https://github.com/oneclick/rubyinstaller2/releases/download/RubyInstaller-2.7.0-1/rubyinstaller-2.7.0-1-x64.7z" "2.7.0": "https://github.com/oneclick/rubyinstaller2/releases/download/RubyInstaller-2.7.0-1/rubyinstaller-2.7.0-1-x64.7z",
"head": "https://github.com/oneclick/rubyinstaller2/releases/download/rubyinstaller-head/rubyinstaller-head-x64.7z"
} }
Generated
+26
View File
@@ -108,6 +108,13 @@ astral-regex@^1.0.0:
resolved "https://registry.yarnpkg.com/astral-regex/-/astral-regex-1.0.0.tgz#6c8c3fb827dd43ee3918f27b82782ab7658a6fd9" resolved "https://registry.yarnpkg.com/astral-regex/-/astral-regex-1.0.0.tgz#6c8c3fb827dd43ee3918f27b82782ab7658a6fd9"
integrity sha512-+Ryf6g3BKoRc7jfp7ad8tM4TtMiaWvbF/1/sQcZPkkS7ag3D5nMBCe2UfOTONtAkaG0tO0ij3C5Lwmf1EiyjHg== integrity sha512-+Ryf6g3BKoRc7jfp7ad8tM4TtMiaWvbF/1/sQcZPkkS7ag3D5nMBCe2UfOTONtAkaG0tO0ij3C5Lwmf1EiyjHg==
axios@^0.19.0:
version "0.19.2"
resolved "https://registry.yarnpkg.com/axios/-/axios-0.19.2.tgz#3ea36c5d8818d0d5f8a8a97a6d36b86cdc00cb27"
integrity sha512-fjgm5MvRHLhx+osE2xoekY70AhARk3a6hkN+3Io1jc00jtquGvxYlKlsFUhmUET0V5te6CcZI7lcv2Ym61mjHA==
dependencies:
follow-redirects "1.5.10"
balanced-match@^1.0.0: balanced-match@^1.0.0:
version "1.0.0" version "1.0.0"
resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.0.tgz#89b4d199ab2bee49de164ea02b89ce462d71b767" resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.0.tgz#89b4d199ab2bee49de164ea02b89ce462d71b767"
@@ -180,6 +187,13 @@ cross-spawn@^6.0.5:
shebang-command "^1.2.0" shebang-command "^1.2.0"
which "^1.2.9" which "^1.2.9"
debug@=3.1.0:
version "3.1.0"
resolved "https://registry.yarnpkg.com/debug/-/debug-3.1.0.tgz#5bb5a0672628b64149566ba16819e61518c67261"
integrity sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g==
dependencies:
ms "2.0.0"
debug@^4.0.1: debug@^4.0.1:
version "4.1.1" version "4.1.1"
resolved "https://registry.yarnpkg.com/debug/-/debug-4.1.1.tgz#3b72260255109c6b589cee050f1d516139664791" resolved "https://registry.yarnpkg.com/debug/-/debug-4.1.1.tgz#3b72260255109c6b589cee050f1d516139664791"
@@ -367,6 +381,13 @@ flatted@^2.0.0:
resolved "https://registry.yarnpkg.com/flatted/-/flatted-2.0.1.tgz#69e57caa8f0eacbc281d2e2cb458d46fdb449e08" resolved "https://registry.yarnpkg.com/flatted/-/flatted-2.0.1.tgz#69e57caa8f0eacbc281d2e2cb458d46fdb449e08"
integrity sha512-a1hQMktqW9Nmqr5aktAux3JMNqaucxGcjtjWnZLHX7yyPCmlSV3M54nGYbqT8K+0GhF3NBgmJCc3ma+WOgX8Jg== integrity sha512-a1hQMktqW9Nmqr5aktAux3JMNqaucxGcjtjWnZLHX7yyPCmlSV3M54nGYbqT8K+0GhF3NBgmJCc3ma+WOgX8Jg==
follow-redirects@1.5.10:
version "1.5.10"
resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.5.10.tgz#7b7a9f9aea2fdff36786a94ff643ed07f4ff5e2a"
integrity sha512-0V5l4Cizzvqt5D44aTXbFZz+FtyXV1vrDN6qrelxtfYQKW0KO0W2T/hkE8xvGa/540LkZlkaUjO4ailYTFtHVQ==
dependencies:
debug "=3.1.0"
fs.realpath@^1.0.0: fs.realpath@^1.0.0:
version "1.0.0" version "1.0.0"
resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f" resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f"
@@ -557,6 +578,11 @@ mkdirp@^0.5.1:
dependencies: dependencies:
minimist "0.0.8" minimist "0.0.8"
ms@2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/ms/-/ms-2.0.0.tgz#5608aeadfc00be6c2901df5f9861788de0d597c8"
integrity sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=
ms@^2.1.1: ms@^2.1.1:
version "2.1.2" version "2.1.2"
resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.2.tgz#d09d1f357b443f493382a8eb3ccd183872ae6009" resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.2.tgz#d09d1f357b443f493382a8eb3ccd183872ae6009"