Add BuildJet Option (#154)
This commit is contained in:
16
src/utils.ts
16
src/utils.ts
@@ -1,3 +1,5 @@
|
||||
import * as buildjetCache from "@actions/buildjet-cache";
|
||||
import * as ghCache from "@actions/cache";
|
||||
import * as core from "@actions/core";
|
||||
import * as exec from "@actions/exec";
|
||||
|
||||
@@ -28,3 +30,17 @@ export async function getCmdOutput(
|
||||
}
|
||||
return stdout;
|
||||
}
|
||||
|
||||
export function getCacheHandler() {
|
||||
const cacheProvider = core.getInput("cache-provider");
|
||||
switch (cacheProvider) {
|
||||
case 'github':
|
||||
core.info ("Using Github Cache.");
|
||||
return ghCache;
|
||||
case 'buildjet':
|
||||
core.info ("Using Buildjet Cache.");
|
||||
return buildjetCache;
|
||||
default:
|
||||
throw new Error("Only currently support github and buildjet caches");
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user