Detect self-hosted runners not matching a GitHub-hosted runner image

* And give instructions for that case.
* Get the OS and OS version ourselves since some users set ImageOS incorrectly.
* This partially reverts commit ad1ebae995.
This commit is contained in:
Benoit Daloze
2023-03-03 16:33:57 +01:00
parent 2789f85824
commit 66dc012cc3
9 changed files with 440 additions and 140 deletions
+2 -2
View File
@@ -46,7 +46,7 @@ export async function setupRuby(options = {}) {
const [engine, parsedVersion] = parseRubyEngineAndVersion(inputs['ruby-version'])
let installer
if (platform.startsWith('windows-') && engine === 'ruby') {
if (platform.startsWith('windows-') && engine === 'ruby' && !common.isSelfHostedRunner()) {
installer = require('./windows')
} else {
installer = require('./ruby-builder')
@@ -60,7 +60,7 @@ export async function setupRuby(options = {}) {
// JRuby can use compiled extension code, so make sure gcc exists.
// As of Jan-2022, JRuby compiles against msvcrt.
if (platform.startsWith('windows') && (engine === 'jruby') &&
if (platform.startsWith('windows') && engine === 'jruby' &&
!fs.existsSync('C:\\msys64\\mingw64\\bin\\gcc.exe')) {
await require('./windows').installJRubyTools()
}