Introduce TRAP caching
This commit is contained in:
parent
cade2b5621
commit
8f867dcb21
52 changed files with 923 additions and 69 deletions
|
|
@ -15,7 +15,7 @@ import {
|
|||
import { getGitHubVersionActionsOnly } from "./api-client";
|
||||
import { CodeQL, CODEQL_VERSION_NEW_TRACING } from "./codeql";
|
||||
import * as configUtils from "./config-utils";
|
||||
import { GitHubFeatureFlags } from "./feature-flags";
|
||||
import { FeatureFlag, FeatureFlags, GitHubFeatureFlags } from "./feature-flags";
|
||||
import {
|
||||
initCodeQL,
|
||||
initConfig,
|
||||
|
|
@ -27,18 +27,18 @@ import { Language } from "./languages";
|
|||
import { getActionsLogger } from "./logging";
|
||||
import { parseRepositoryNwo } from "./repository";
|
||||
import {
|
||||
getRequiredEnvParam,
|
||||
initializeEnvironment,
|
||||
Mode,
|
||||
checkActionVersion,
|
||||
checkGitHubVersionInRange,
|
||||
codeQlVersionAbove,
|
||||
enrichEnvironment,
|
||||
getMemoryFlagValue,
|
||||
getThreadsFlagValue,
|
||||
DEFAULT_DEBUG_ARTIFACT_NAME,
|
||||
DEFAULT_DEBUG_DATABASE_NAME,
|
||||
enrichEnvironment,
|
||||
getMemoryFlagValue,
|
||||
getMlPoweredJsQueriesStatus,
|
||||
checkActionVersion,
|
||||
getRequiredEnvParam,
|
||||
getThreadsFlagValue,
|
||||
initializeEnvironment,
|
||||
Mode,
|
||||
} from "./util";
|
||||
|
||||
// eslint-disable-next-line import/no-commonjs
|
||||
|
|
@ -183,6 +183,7 @@ async function run() {
|
|||
getOptionalInput("packs"),
|
||||
getOptionalInput("config-file"),
|
||||
getOptionalInput("db-location"),
|
||||
await getTrapCachingEnabled(featureFlags),
|
||||
// Debug mode is enabled if:
|
||||
// - The `init` Action is passed `debug: true`.
|
||||
// - Actions step debugging is enabled (e.g. by [enabling debug logging for a rerun](https://docs.github.com/en/actions/managing-workflow-runs/re-running-workflows-and-jobs#re-running-all-the-jobs-in-a-workflow),
|
||||
|
|
@ -299,6 +300,13 @@ async function run() {
|
|||
await sendSuccessStatusReport(startedAt, config, toolsVersion);
|
||||
}
|
||||
|
||||
function getTrapCachingEnabled(featureFlags: FeatureFlags): Promise<boolean> {
|
||||
const trapCaching = getOptionalInput("trap-caching");
|
||||
if (trapCaching !== undefined)
|
||||
return Promise.resolve(trapCaching.toLowerCase() === "true");
|
||||
return featureFlags.getValue(FeatureFlag.TrapCachingEnabled);
|
||||
}
|
||||
|
||||
async function runWrapper() {
|
||||
try {
|
||||
await run();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue