mirror of
https://github.com/github/codeql-action.git
synced 2025-12-27 17:50:07 +08:00
Add build mode to configuration
This commit is contained in:
@@ -45,6 +45,7 @@ function createTestInitConfigInputs(
|
||||
configFile: undefined,
|
||||
dbLocation: undefined,
|
||||
configInput: undefined,
|
||||
buildModeInput: undefined,
|
||||
trapCachingEnabled: false,
|
||||
debugMode: false,
|
||||
debugArtifactName: "",
|
||||
@@ -322,6 +323,7 @@ test("load non-empty input", async (t) => {
|
||||
// And the config we expect it to parse to
|
||||
const expectedConfig: configUtils.Config = {
|
||||
languages: [Language.javascript],
|
||||
buildMode: "none",
|
||||
originalUserInput: {
|
||||
name: "my config",
|
||||
"disable-default-queries": true,
|
||||
@@ -347,6 +349,7 @@ test("load non-empty input", async (t) => {
|
||||
const actualConfig = await configUtils.initConfig(
|
||||
createTestInitConfigInputs({
|
||||
languagesInput,
|
||||
buildModeInput: "none",
|
||||
configFile: configFilePath,
|
||||
debugArtifactName: "my-artifact",
|
||||
debugDatabaseName: "my-db",
|
||||
|
||||
@@ -80,6 +80,10 @@ export interface Config {
|
||||
* Set of languages to run analysis for.
|
||||
*/
|
||||
languages: Language[];
|
||||
/**
|
||||
* Build mode, if set. Currently only a single build mode is supported per job.
|
||||
*/
|
||||
buildMode: string | undefined;
|
||||
/**
|
||||
* A unaltered copy of the original user input.
|
||||
* Mainly intended to be used for status reporting.
|
||||
@@ -399,6 +403,7 @@ export interface InitConfigInputs {
|
||||
configFile: string | undefined;
|
||||
dbLocation: string | undefined;
|
||||
configInput: string | undefined;
|
||||
buildModeInput: string | undefined;
|
||||
trapCachingEnabled: boolean;
|
||||
debugMode: boolean;
|
||||
debugArtifactName: string;
|
||||
@@ -428,6 +433,7 @@ export async function getDefaultConfig({
|
||||
languagesInput,
|
||||
queriesInput,
|
||||
packsInput,
|
||||
buildModeInput,
|
||||
dbLocation,
|
||||
trapCachingEnabled,
|
||||
debugMode,
|
||||
@@ -460,6 +466,7 @@ export async function getDefaultConfig({
|
||||
|
||||
return {
|
||||
languages,
|
||||
buildMode: buildModeInput,
|
||||
originalUserInput: {},
|
||||
tempDir,
|
||||
codeQLCmd: codeql.getPath(),
|
||||
@@ -500,6 +507,7 @@ async function loadConfig({
|
||||
languagesInput,
|
||||
queriesInput,
|
||||
packsInput,
|
||||
buildModeInput,
|
||||
configFile,
|
||||
dbLocation,
|
||||
trapCachingEnabled,
|
||||
@@ -546,6 +554,7 @@ async function loadConfig({
|
||||
|
||||
return {
|
||||
languages,
|
||||
buildMode: buildModeInput,
|
||||
originalUserInput: parsedYAML,
|
||||
tempDir,
|
||||
codeQLCmd: codeql.getPath(),
|
||||
|
||||
@@ -269,6 +269,7 @@ async function run() {
|
||||
languagesInput: getOptionalInput("languages"),
|
||||
queriesInput: getOptionalInput("queries"),
|
||||
packsInput: getOptionalInput("packs"),
|
||||
buildModeInput: getOptionalInput("build-mode"),
|
||||
configFile: getOptionalInput("config-file"),
|
||||
dbLocation: getOptionalInput("db-location"),
|
||||
configInput: getOptionalInput("config"),
|
||||
|
||||
@@ -304,6 +304,7 @@ export function createTestConfig(overrides: Partial<Config>): Config {
|
||||
{},
|
||||
{
|
||||
languages: [],
|
||||
buildMode: undefined,
|
||||
originalUserInput: {},
|
||||
tempDir: "",
|
||||
codeQLCmd: "",
|
||||
|
||||
Reference in New Issue
Block a user