Store dependency caches in `analyze` Action

This commit is contained in:
Michael B. Gale 2024-07-26 13:34:24 +01:00
Родитель 471ed9f4c5
Коммит 5b057af8ce
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: FF5E2765BD00628F
6 изменённых файлов: 13 добавлений и 18 удалений

5
lib/analyze-action.js сгенерированный
Просмотреть файл

@ -38,6 +38,7 @@ const autobuild_1 = require("./autobuild");
const codeql_1 = require("./codeql");
const config_utils_1 = require("./config-utils");
const database_upload_1 = require("./database-upload");
const dependency_caching_1 = require("./dependency-caching");
const environment_1 = require("./environment");
const feature_flags_1 = require("./feature-flags");
const languages_1 = require("./languages");
@ -204,6 +205,10 @@ async function run() {
trapCacheUploadTime = perf_hooks_1.performance.now() - trapCacheUploadStartTime;
// Clean up TRAP caches
trapCacheCleanupTelemetry = await (0, trap_caching_1.cleanupTrapCaches)(config, features, logger);
// Store dependency cache(s) if dependency caching is enabled.
if (config.dependencyCachingEnabled) {
await (0, dependency_caching_1.uploadDependencyCaches)(config, logger);
}
// We don't upload results in test mode, so don't wait for processing
if (util.isInTestMode()) {
logger.debug("In test mode. Waiting for processing is disabled.");

Различия файлов скрыты, потому что одна или несколько строк слишком длинны

6
lib/init-action-post.js сгенерированный
Просмотреть файл

@ -33,7 +33,6 @@ const actions_util_1 = require("./actions-util");
const api_client_1 = require("./api-client");
const config_utils_1 = require("./config-utils");
const debugArtifacts = __importStar(require("./debug-artifacts"));
const dependency_caching_1 = require("./dependency-caching");
const feature_flags_1 = require("./feature-flags");
const initActionPostHelper = __importStar(require("./init-action-post-helper"));
const logging_1 = require("./logging");
@ -79,11 +78,6 @@ async function runWrapper() {
};
await (0, status_report_1.sendStatusReport)(statusReport);
}
// Store dependency cache(s) if the job was successful and dependency caching is enabled.
if (jobStatus === status_report_1.JobStatus.SuccessStatus &&
config.dependencyCachingEnabled) {
await (0, dependency_caching_1.uploadDependencyCaches)(config, logger);
}
}
void runWrapper();
//# sourceMappingURL=init-action-post.js.map

Просмотреть файл

@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AAC,OAAO,cAAc,EAAE,CAAC;QACxB,MAAM,KAAK,GAAG,IAAA,gBAAS,EAAC,cAAc,CAAC,CAAC;QACxC,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;QAE9B,MAAM,gBAAgB,GAAG,MAAM,IAAA,sCAAsB,EACnD,0BAAU,CAAC,QAAQ,EACnB,IAAA,gCAAgB,EAAC,KAAK,CAAC,EACvB,SAAS,EACT,MAAM,EACN,MAAM,IAAA,qBAAc,EAAC,MAAM,CAAC,EAC5B,MAAM,EACN,KAAK,CAAC,OAAO,EACb,KAAK,CAAC,KAAK,CACZ,CAAC;QACF,IAAI,gBAAgB,KAAK,SAAS,EAAE,CAAC;YACnC,MAAM,IAAA,gCAAgB,EAAC,gBAAgB,CAAC,CAAC;QAC3C,CAAC;QACD,OAAO;IACT,CAAC;IACD,MAAM,SAAS,GAAG,oBAAoB,CAAC,iBAAiB,EAAE,CAAC;IAC3D,MAAM,CAAC,IAAI,CAAC,yBAAyB,IAAA,uCAAuB,EAAC,SAAS,CAAC,GAAG,CAAC,CAAC;IAE5E,MAAM,gBAAgB,GAAG,MAAM,IAAA,sCAAsB,EACnD,0BAAU,CAAC,QAAQ,EACnB,SAAS,EACT,SAAS,EACT,MAAM,EACN,MAAM,IAAA,qBAAc,EAAC,MAAM,CAAC,EAC5B,MAAM,CACP,CAAC;IACF,IAAI,gBAAgB,KAAK,SAAS,EAAE,CAAC;QACnC,MAAM,YAAY,GAAyB;YACzC,GAAG,gBAAgB;YACnB,GAAG,uBAAuB;YAC1B,UAAU,EAAE,oBAAoB,CAAC,iBAAiB,EAAE;SACrD,CAAC;QACF,MAAM,IAAA,gCAAgB,EAAC,YAAY,CAAC,CAAC;IACvC,CAAC;AACH,CAAC;AAED,KAAK,UAAU,EAAE,CAAC"}

Просмотреть файл

@ -19,6 +19,7 @@ import { runAutobuild } from "./autobuild";
import { getCodeQL } from "./codeql";
import { Config, getConfig } from "./config-utils";
import { uploadDatabases } from "./database-upload";
import { uploadDependencyCaches } from "./dependency-caching";
import { EnvVar } from "./environment";
import { Features } from "./feature-flags";
import { Language } from "./languages";
@ -328,6 +329,11 @@ async function run() {
logger,
);
// Store dependency cache(s) if dependency caching is enabled.
if (config.dependencyCachingEnabled) {
await uploadDependencyCaches(config, logger);
}
// We don't upload results in test mode, so don't wait for processing
if (util.isInTestMode()) {
logger.debug("In test mode. Waiting for processing is disabled.");

Просмотреть файл

@ -14,7 +14,6 @@ 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";
@ -26,7 +25,6 @@ import {
getActionsStatus,
ActionName,
getJobStatusDisplayName,
JobStatus,
} from "./status-report";
import {
checkDiskUsage,
@ -118,14 +116,6 @@ 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();