mirror of
https://github.com/github/codeql-action.git
synced 2026-01-06 22:50:17 +08:00
Store and restore dependency caches in init Action
This commit is contained in:
@@ -14,6 +14,7 @@ import {
|
||||
import { getGitHubVersion } from "./api-client";
|
||||
import { Config, getConfig } from "./config-utils";
|
||||
import * as debugArtifacts from "./debug-artifacts";
|
||||
import { uploadDependencyCaches } from "./dependency-caching";
|
||||
import { Features } from "./feature-flags";
|
||||
import * as initActionPostHelper from "./init-action-post-helper";
|
||||
import { getActionsLogger } from "./logging";
|
||||
@@ -25,6 +26,7 @@ import {
|
||||
getActionsStatus,
|
||||
ActionName,
|
||||
getJobStatusDisplayName,
|
||||
JobStatus,
|
||||
} from "./status-report";
|
||||
import {
|
||||
checkDiskUsage,
|
||||
@@ -116,6 +118,14 @@ async function runWrapper() {
|
||||
};
|
||||
await sendStatusReport(statusReport);
|
||||
}
|
||||
|
||||
// Store dependency cache(s) if the job was successful and dependency caching is enabled.
|
||||
if (
|
||||
jobStatus === JobStatus.SuccessStatus &&
|
||||
config.dependencyCachingEnabled
|
||||
) {
|
||||
await uploadDependencyCaches(config, logger);
|
||||
}
|
||||
}
|
||||
|
||||
void runWrapper();
|
||||
|
||||
@@ -17,6 +17,7 @@ import {
|
||||
import { getGitHubVersion } from "./api-client";
|
||||
import { CodeQL } from "./codeql";
|
||||
import * as configUtils from "./config-utils";
|
||||
import { downloadDependencyCaches } from "./dependency-caching";
|
||||
import {
|
||||
addDiagnostic,
|
||||
flushDiagnostics,
|
||||
@@ -557,6 +558,11 @@ async function run() {
|
||||
core.exportVariable(bmnVar, value);
|
||||
}
|
||||
|
||||
// Restore dependency cache(s), if they exist.
|
||||
if (config.dependencyCachingEnabled) {
|
||||
await downloadDependencyCaches(config.languages, logger);
|
||||
}
|
||||
|
||||
// For CLI versions <2.15.1, build tracing caused errors in MacOS ARM machines with
|
||||
// System Integrity Protection (SIP) disabled.
|
||||
if (
|
||||
|
||||
Reference in New Issue
Block a user