Compare commits

..
5 Commits
Author SHA1 Message Date
Benoit Daloze ea86920b92 Add windows-2016 to supported platforms
* Recommend to use *-latest.
2020-06-11 13:22:47 +02:00
Johnny Willemsen a43803ce44 Test all virtual environments, not just the latest, and added crontab (#60) 2020-06-11 13:15:53 +02:00
Benoit Daloze bf8b766096 Cleanups 2020-06-10 23:44:28 +02:00
MSP-Greg 44338c51c7 Fix tar extraction with windows-2016 image
1. common.js - add function win2nix(path) to convert windows style paths to nix style

2. ruby_builder.js - use Git tar for windows-2016, leave windows-2019 as is
2020-06-10 23:41:09 +02:00
Sora Morimoto 037dfa7b6b Update README.md 2020-06-09 15:38:02 +02:00
5 changed files with 61 additions and 24 deletions
+17 -11
View File
@@ -8,25 +8,31 @@ on:
- '*' - '*'
paths-ignore: paths-ignore:
- README.md - README.md
schedule:
- cron: '0 7 * * SUN'
jobs: jobs:
test: test:
strategy: strategy:
fail-fast: false fail-fast: false
matrix: matrix:
os: [ ubuntu, macos, windows ] os: [ ubuntu-16.04, ubuntu-18.04, ubuntu-20.04, macos-10.15, windows-2016, windows-2019 ]
# Use various version syntax here for testing # Use various version syntax here for testing
ruby: [ 2.2, 2.3, 2.4, 2.5, 2.6.6, 2.7, ruby-head, debug, jruby-9.1, jruby, jruby-head, truffleruby, truffleruby-head ] ruby: [ 2.2, 2.3, 2.4, 2.5, 2.6.6, 2.7, ruby-head, debug, jruby-9.1, jruby, jruby-head, truffleruby, truffleruby-head ]
include: include:
- { os: ubuntu, ruby: rubinius } - { os: ubuntu-18.04, ruby: rubinius }
- { os: windows, ruby: mingw } - { os: windows-2016, ruby: mingw }
- { os: windows, ruby: mswin } - { os: windows-2019, ruby: mingw }
- { os: windows-2019, ruby: mswin }
exclude: exclude:
- { os: windows, ruby: debug } - { os: windows-2016, ruby: debug }
- { os: windows, ruby: truffleruby } - { os: windows-2016, ruby: truffleruby }
- { os: windows, ruby: truffleruby-head } - { os: windows-2016, ruby: truffleruby-head }
- { os: windows-2019, ruby: debug }
- { os: windows-2019, ruby: truffleruby }
- { os: windows-2019, ruby: truffleruby-head }
name: ${{ matrix.os }} ${{ matrix.ruby }} name: ${{ matrix.os }} ${{ matrix.ruby }}
runs-on: ${{ matrix.os }}-latest runs-on: ${{ matrix.os }}
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v2
@@ -39,7 +45,7 @@ jobs:
run: | run: |
ruby -e "puts 'build compiler: ' + RbConfig::CONFIG.fetch('CC_VERSION_MESSAGE', 'unknown').lines.first" ruby -e "puts 'build compiler: ' + RbConfig::CONFIG.fetch('CC_VERSION_MESSAGE', 'unknown').lines.first"
- name: gcc and ridk version (mingw) - name: gcc and ridk version (mingw)
if: matrix.os == 'windows' if: startsWith(matrix.os, 'windows')
run: | run: |
$abi, $plat = $(ruby -e "STDOUT.write RbConfig::CONFIG['ruby_version'] + ' ' + RUBY_PLATFORM").split(' ') $abi, $plat = $(ruby -e "STDOUT.write RbConfig::CONFIG['ruby_version'] + ' ' + RUBY_PLATFORM").split(' ')
if ($plat.Contains('mingw')) { if ($plat.Contains('mingw')) {
@@ -65,10 +71,10 @@ jobs:
- run: bundle exec rake --version - run: bundle exec rake --version
- name: which ruby, rake - name: which ruby, rake
if: matrix.os != 'windows' if: "!startsWith(matrix.os, 'windows')"
run: which -a ruby rake run: which -a ruby rake
- name: where ruby, rake - name: where ruby, rake
if: matrix.os == 'windows' if: startsWith(matrix.os, 'windows')
run: | run: |
$ErrorActionPreference = 'Continue' $ErrorActionPreference = 'Continue'
$where = 'ruby', 'rake' $where = 'ruby', 'rake'
+7 -7
View File
@@ -33,13 +33,13 @@ On Windows, Ruby 2.4 uses OpenSSL 1.0.2, which is no longer maintained.
The action works for all [GitHub-hosted runners](https://help.github.com/en/actions/automating-your-workflow-with-github-actions/virtual-environments-for-github-hosted-runners). The action works for all [GitHub-hosted runners](https://help.github.com/en/actions/automating-your-workflow-with-github-actions/virtual-environments-for-github-hosted-runners).
| Operating System | Versions | | Operating System | Recommended | Other Supported Versions |
| ----------- | -------- | | ----------- | -------- | -------- |
| Ubuntu | `ubuntu-20.04`, `ubuntu-latest` (= `ubuntu-18.04`), `ubuntu-16.04` | | Ubuntu | `ubuntu-latest` (= `ubuntu-18.04`) | `ubuntu-20.04`, `ubuntu-16.04` |
| macOS | `macos-latest` | | macOS | `macos-latest` (= `macos-10.15`) | |
| Windows | `windows-latest` | | Windows | `windows-latest` (= `windows-2019`) | `windows-2016` |
Rubinius is only available on `ubuntu-latest`. Rubinius is only available on `ubuntu-18.04`.
The prebuilt releases are generated by [ruby-builder](https://github.com/ruby/ruby-builder) The prebuilt releases are generated by [ruby-builder](https://github.com/ruby/ruby-builder)
and on Windows by [RubyInstaller2](https://github.com/oneclick/rubyinstaller2). and on Windows by [RubyInstaller2](https://github.com/oneclick/rubyinstaller2).
@@ -121,7 +121,7 @@ This behavior can be customized, see [action.yml](action.yml) for details about
You can cache the installed gems with these two steps: You can cache the installed gems with these two steps:
```yaml ```yaml
- uses: actions/cache@v1 - uses: actions/cache@v2
with: with:
path: vendor/bundle path: vendor/bundle
key: bundle-use-ruby-${{ matrix.os }}-${{ matrix.ruby }}-${{ hashFiles('**/Gemfile.lock') }} key: bundle-use-ruby-${{ matrix.os }}-${{ matrix.ruby }}-${{ hashFiles('**/Gemfile.lock') }}
+9
View File
@@ -42,3 +42,12 @@ function findUbuntuVersion() {
throw new Error('Could not find Ubuntu version') throw new Error('Could not find Ubuntu version')
} }
} }
// convert windows path like C:\Users\runneradmin to /c/Users/runneradmin
export function win2nix(path) {
if (/^[A-Z]:/i.test(path)) {
// path starts with drive
path = `/${path[0].toLowerCase()}${path.split(':', 2)[1]}`
}
return path.replace(/\\/g, '/').replace(/ /g, '\\ ')
}
Generated Vendored
+19 -3
View File
@@ -1521,6 +1521,7 @@ __webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "measure", function() { return measure; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "measure", function() { return measure; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isHeadVersion", function() { return isHeadVersion; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isHeadVersion", function() { return isHeadVersion; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getVirtualEnvironmentName", function() { return getVirtualEnvironmentName; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getVirtualEnvironmentName", function() { return getVirtualEnvironmentName; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "win2nix", function() { return win2nix; });
const os = __webpack_require__(87) const os = __webpack_require__(87)
const fs = __webpack_require__(747) const fs = __webpack_require__(747)
const core = __webpack_require__(470) const core = __webpack_require__(470)
@@ -1566,6 +1567,15 @@ function findUbuntuVersion() {
} }
} }
// convert windows path like C:\Users\runneradmin to /c/Users/runneradmin
function win2nix(path) {
if (/^[A-Z]:/i.test(path)) {
// path starts with drive
path = `/${path[0].toLowerCase()}${path.split(':', 2)[1]}`
}
return path.replace(/\\/g, '/').replace(/ /g, '\\ ')
}
/***/ }), /***/ }),
@@ -3582,9 +3592,15 @@ async function downloadAndExtract(platform, engine, version) {
return await tc.downloadTool(url) return await tc.downloadTool(url)
}) })
const tar = platform.startsWith('windows') ? 'C:\\Windows\\system32\\tar.exe' : 'tar' await common.measure('Extracting Ruby', async () => {
await common.measure('Extracting Ruby', async () => if (process.env.ImageOS === 'win16') {
exec.exec(tar, [ '-xz', '-C', rubiesDir, '-f', downloadPath ])) const tar = '"C:\\Program Files\\Git\\usr\\bin\\tar.exe"'
await exec.exec(tar, [ '-xz', '-C', common.win2nix(rubiesDir), '-f', common.win2nix(downloadPath) ])
} else {
const tar = platform.startsWith('windows') ? 'C:\\Windows\\system32\\tar.exe' : 'tar'
await exec.exec(tar, [ '-xz', '-C', rubiesDir, '-f', downloadPath ])
}
})
return path.join(rubiesDir, `${engine}-${version}`) return path.join(rubiesDir, `${engine}-${version}`)
} }
+9 -3
View File
@@ -34,9 +34,15 @@ async function downloadAndExtract(platform, engine, version) {
return await tc.downloadTool(url) return await tc.downloadTool(url)
}) })
const tar = platform.startsWith('windows') ? 'C:\\Windows\\system32\\tar.exe' : 'tar' await common.measure('Extracting Ruby', async () => {
await common.measure('Extracting Ruby', async () => if (process.env.ImageOS === 'win16') {
exec.exec(tar, [ '-xz', '-C', rubiesDir, '-f', downloadPath ])) const tar = '"C:\\Program Files\\Git\\usr\\bin\\tar.exe"'
await exec.exec(tar, [ '-xz', '-C', common.win2nix(rubiesDir), '-f', common.win2nix(downloadPath) ])
} else {
const tar = platform.startsWith('windows') ? 'C:\\Windows\\system32\\tar.exe' : 'tar'
await exec.exec(tar, [ '-xz', '-C', rubiesDir, '-f', downloadPath ])
}
})
return path.join(rubiesDir, `${engine}-${version}`) return path.join(rubiesDir, `${engine}-${version}`)
} }