diff --git a/dist/index.js b/dist/index.js index 9c01c1f..5b6d4a6 100644 --- a/dist/index.js +++ b/dist/index.js @@ -44,7 +44,7 @@ class ExecStack { .concat(args); } async upgrade() { - return await exec.exec("stack", ["upgrade"]); + return await exec.exec("stack", ["upgrade"], { ignoreReturnCode: true }); } async exec(args, options) { return await exec.exec("stack", this.stackArguments.concat(args), options); @@ -129,11 +129,10 @@ const glob_1 = __nccwpck_require__(8090); exports.ALL_SOURCES_PATTERNS = `**\n!**${path.sep}.stack-work\n!.git\n`; exports.BUILD_FILES_PATTERNS = `**${path.sep}package.yaml\n**${path.sep}*.cabal\n`; async function hashProject(stackYaml) { - const workspace = process.cwd(); return { - snapshot: await (0, glob_1.hashFiles)(stackYaml, workspace), - package: await (0, glob_1.hashFiles)(exports.BUILD_FILES_PATTERNS, workspace), - sources: await (0, glob_1.hashFiles)(exports.ALL_SOURCES_PATTERNS, workspace), + snapshot: await (0, glob_1.hashFiles)(stackYaml), + package: await (0, glob_1.hashFiles)(exports.BUILD_FILES_PATTERNS), + sources: await (0, glob_1.hashFiles)(exports.ALL_SOURCES_PATTERNS), }; } exports.hashProject = hashProject; @@ -277,8 +276,10 @@ async function run() { await stack.upgrade(); }); const stackRoot = (await stack.parse(["path", "--stack-root]"], parse_stack_path_1.parseStackPath))["stack-root"]; + core.info(`Stack root: ${stackRoot}`); const stackYaml = (0, stack_yaml_1.readStackYamlSync)(inputs.stackYaml); const stackWorks = (0, stack_yaml_1.packagesStackWorks)(stackYaml); + core.info(`Stack works:\n - ${stackWorks.join("\n - ")}`); await core.group("Dependencies", async () => { const cacheKeys = (0, get_cache_keys_1.getCacheKeys)([ inputs.cachePrefix("stack-deps", stackYaml.resolver), @@ -303,15 +304,22 @@ async function run() { skipOnHit: false, }); }); - if (inputs.test) { - await core.group("Test", async () => await test(stack, inputs)); - } + await core.group("Test", async () => { + if (inputs.test) { + await test(stack, inputs); + } + }); const stackQuery = await stack.parse(["query", "compiler"], parse_stack_query_1.parseStackQuery); - core.setOutput("compiler", stackQuery.compiler.actual); - core.setOutput("compiler-version", stackQuery.compiler.actual.replace(/^ghc-/, "")); + const compiler = stackQuery.compiler.actual; + const compilerVersion = compiler.replace(/^ghc-/, ""); + core.debug(`Setting compiler outputs: ${compiler} / ${compilerVersion}`); + core.setOutput("compiler", compiler); + core.setOutput("compiler-version", compilerVersion); const stackPath = await stack.parse(["path"], parse_stack_path_1.parseStackPath); for (const k in stackPath) { - core.setOutput(k, stackPath[k]); + const v = stackPath[k]; + core.debug(`Setting stack-path output: ${k}=${v}`); + core.setOutput(k, v); } } catch (error) {