Adds extra caches for pulling from (binary substitution).

Creates an `extraPullNames` parameter, to mimic the existing `name`
parameter. This string should be a comma-separated set of cache names.
This commit is contained in:
Gary Coady 2020-06-23 10:28:19 +02:00
commit 49b785b55a
3 changed files with 23 additions and 0 deletions

View file

@ -5,6 +5,8 @@ inputs:
name:
description: 'Name of a cachix cache to push and pull/substitute'
required: true
extraPullNames:
description: 'Comma-separated list of names for extra cachix caches to pull/substitute'
authToken:
description: 'Authentication token for Cachix, needed only for private cache access'
signingKey:

10
dist/main/index.js vendored
View file

@ -977,6 +977,7 @@ const exec = __importStar(__webpack_require__(986));
exports.IsPost = !!process.env['STATE_isPost'];
// inputs
const name = core.getInput('name', { required: true });
const extraPullNames = core.getInput('extraPullNames');
const signingKey = core.getInput('signingKey');
const authToken = core.getInput('authToken');
const skipPush = core.getInput('skipPush');
@ -994,6 +995,15 @@ function setup() {
core.startGroup(`Cachix: using cache ` + name);
yield exec.exec('cachix', ['use', name]);
core.endGroup();
if (extraPullNames != "") {
core.startGroup(`Cachix: using extra caches ` + extraPullNames);
const extraPullNameList = extraPullNames.split(',');
for (let itemName of extraPullNameList) {
const trimmedItemName = itemName.trim();
yield exec.exec('cachix', ['use', trimmedItemName]);
}
core.endGroup();
}
if (signingKey !== "") {
core.exportVariable('CACHIX_SIGNING_KEY', signingKey);
// Remember existing store paths

View file

@ -7,6 +7,7 @@ export const IsPost = !!process.env['STATE_isPost']
// inputs
const name = core.getInput('name', { required: true });
const extraPullNames = core.getInput('extraPullNames');
const signingKey = core.getInput('signingKey');
const authToken = core.getInput('authToken')
const skipPush = core.getInput('skipPush');
@ -27,6 +28,16 @@ async function setup() {
await exec.exec('cachix', ['use', name]);
core.endGroup();
if (extraPullNames != "") {
core.startGroup(`Cachix: using extra caches ` + extraPullNames);
const extraPullNameList = extraPullNames.split(',');
for (let itemName of extraPullNameList) {
const trimmedItemName = itemName.trim();
await exec.exec('cachix', ['use', trimmedItemName]);
}
core.endGroup();
}
if (signingKey !== "") {
core.exportVariable('CACHIX_SIGNING_KEY', signingKey);
// Remember existing store paths