Merge pull request #34 from cachix/log-consistency

A tiny bit more consistent logging
This commit is contained in:
Domen Kožar 2020-03-14 11:55:33 +01:00 committed by GitHub
commit a8b57eca98
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 16 additions and 13 deletions

View file

@ -31,7 +31,7 @@ function run() {
const signingKey = core.getInput('signingKey');
const authToken = core.getInput('authToken');
const cachixExecutable = "/nix/var/nix/profiles/per-user/runner/profile/bin/cachix";
core.startGroup('Installing Cachix');
core.startGroup('Cachix: installing');
yield exec.exec('nix-env', ['-iA', 'cachix', '-f', 'https://cachix.org/api/v1/install']);
core.endGroup();
// for private caches
@ -45,7 +45,10 @@ function run() {
core.exportVariable('CACHIX_SIGNING_KEY', signingKey);
}
if (skipNixBuild !== 'true') {
core.startGroup(`Invoking nix-build`);
const args = strings_1.prependEach('-A', strings_1.nonEmptySplit(attributes, /\s+/)).concat([file || "default.nix"]);
const additionalArgs = strings_1.nonEmptySplit(nixBuildArgs, /\s+/);
const allArgs = additionalArgs.concat(args);
core.startGroup(`nix-build {allArgs.join(' ')}`);
if (signingKey !== "") {
// Remember existing store paths
yield exec.exec("sh", ["-c", `nix path-info --all | grep -v '\.drv$' > store-path-pre-build`]);
@ -58,12 +61,10 @@ function run() {
},
}
};
const args = strings_1.prependEach('-A', strings_1.nonEmptySplit(attributes, /\s+/)).concat([file || "default.nix"]);
const additionalArgs = strings_1.nonEmptySplit(nixBuildArgs, /\s+/);
yield exec.exec('nix-build', additionalArgs.concat(args), options);
yield exec.exec('nix-build', allArgs, options);
core.endGroup();
if (signingKey !== "") {
core.startGroup('Cachix: Pushing paths');
core.startGroup('Cachix: pushing paths');
yield exec.exec("sh", ["-c", `nix path-info --all | grep -v '\.drv$' | cat - store-path-pre-build | sort | uniq -u | ${cachixExecutable} push ${name}`]);
core.endGroup();
}

View file

@ -16,7 +16,7 @@ async function run() {
const authToken = core.getInput('authToken')
const cachixExecutable = "/nix/var/nix/profiles/per-user/runner/profile/bin/cachix";
core.startGroup('Installing Cachix')
core.startGroup('Cachix: installing')
await exec.exec('nix-env', ['-iA', 'cachix', '-f', 'https://cachix.org/api/v1/install']);
core.endGroup()
@ -25,7 +25,7 @@ async function run() {
await exec.exec(cachixExecutable, ['authtoken', authToken]);
}
core.startGroup(`Cachix: using ` + name);
core.startGroup(`Cachix: using cache ` + name);
await exec.exec('cachix', ['use', name]);
core.endGroup();
@ -34,7 +34,11 @@ async function run() {
}
if (skipNixBuild !== 'true') {
core.startGroup(`Invoking nix-build`);
const args = prependEach('-A', nonEmptySplit(attributes, /\s+/)).concat([file || "default.nix"]);
const additionalArgs = nonEmptySplit(nixBuildArgs, /\s+/);
const allArgs = additionalArgs.concat(args);
core.startGroup(`nix-build ${allArgs.join(' ')}`);
if (signingKey !== "") {
// Remember existing store paths
@ -49,13 +53,11 @@ async function run() {
},
}
};
const args = prependEach('-A', nonEmptySplit(attributes, /\s+/)).concat([file || "default.nix"]);
const additionalArgs = nonEmptySplit(nixBuildArgs, /\s+/);
await exec.exec('nix-build', additionalArgs.concat(args), options);
await exec.exec('nix-build', allArgs, options);
core.endGroup()
if (signingKey !== "") {
core.startGroup('Cachix: Pushing paths');
core.startGroup('Cachix: pushing paths');
await exec.exec("sh", ["-c", `nix path-info --all | grep -v '\.drv$' | cat - store-path-pre-build | sort | uniq -u | ${cachixExecutable} push ${name}`]);
core.endGroup();
}