update tool-cache for proxy and fix tests (#57)

update tool-cache for proxy and fix tests
This commit is contained in:
Bryan MacFarlane
2020-01-31 13:57:22 -05:00
committed by GitHub
parent c38a6d4068
commit 9b0a0db81f
190 changed files with 4708 additions and 14158 deletions

27
src/main.ts Normal file
View File

@@ -0,0 +1,27 @@
import * as core from '@actions/core';
import * as cache from './cache';
export async function run() {
try {
let versionSpec = core.getInput('ruby-version', {required: true});
if (!versionSpec) {
// deprecated
versionSpec = core.getInput('version');
}
// check in the VMs cache first
let toolPath: string = await cache.find(versionSpec);
// TODO: download JIT and/or ruby-build
if (!toolPath) {
core.setFailed(`Version ${versionSpec} not found`);
return;
}
core.addPath(toolPath);
} catch (error) {
// unhandled
core.setFailed(error.message);
}
}