Skip to content

Commit 0166a8a

Browse files
committed
Add build mode to configuration
1 parent 401f9d6 commit 0166a8a

12 files changed

+27
-6
lines changed

lib/config-utils.js

Lines changed: 4 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/config-utils.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/config-utils.test.js

Lines changed: 3 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/config-utils.test.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/init-action.js

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/init-action.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/testing-utils.js

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/testing-utils.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/config-utils.test.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ function createTestInitConfigInputs(
4545
configFile: undefined,
4646
dbLocation: undefined,
4747
configInput: undefined,
48+
buildModeInput: undefined,
4849
trapCachingEnabled: false,
4950
debugMode: false,
5051
debugArtifactName: "",
@@ -322,6 +323,7 @@ test("load non-empty input", async (t) => {
322323
// And the config we expect it to parse to
323324
const expectedConfig: configUtils.Config = {
324325
languages: [Language.javascript],
326+
buildMode: "none",
325327
originalUserInput: {
326328
name: "my config",
327329
"disable-default-queries": true,
@@ -347,6 +349,7 @@ test("load non-empty input", async (t) => {
347349
const actualConfig = await configUtils.initConfig(
348350
createTestInitConfigInputs({
349351
languagesInput,
352+
buildModeInput: "none",
350353
configFile: configFilePath,
351354
debugArtifactName: "my-artifact",
352355
debugDatabaseName: "my-db",

src/config-utils.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,10 @@ export interface Config {
8080
* Set of languages to run analysis for.
8181
*/
8282
languages: Language[];
83+
/**
84+
* Build mode, if set. Currently only a single build mode is supported per job.
85+
*/
86+
buildMode: string | undefined;
8387
/**
8488
* A unaltered copy of the original user input.
8589
* Mainly intended to be used for status reporting.
@@ -399,6 +403,7 @@ export interface InitConfigInputs {
399403
configFile: string | undefined;
400404
dbLocation: string | undefined;
401405
configInput: string | undefined;
406+
buildModeInput: string | undefined;
402407
trapCachingEnabled: boolean;
403408
debugMode: boolean;
404409
debugArtifactName: string;
@@ -428,6 +433,7 @@ export async function getDefaultConfig({
428433
languagesInput,
429434
queriesInput,
430435
packsInput,
436+
buildModeInput,
431437
dbLocation,
432438
trapCachingEnabled,
433439
debugMode,
@@ -460,6 +466,7 @@ export async function getDefaultConfig({
460466

461467
return {
462468
languages,
469+
buildMode: buildModeInput,
463470
originalUserInput: {},
464471
tempDir,
465472
codeQLCmd: codeql.getPath(),
@@ -500,6 +507,7 @@ async function loadConfig({
500507
languagesInput,
501508
queriesInput,
502509
packsInput,
510+
buildModeInput,
503511
configFile,
504512
dbLocation,
505513
trapCachingEnabled,
@@ -546,6 +554,7 @@ async function loadConfig({
546554

547555
return {
548556
languages,
557+
buildMode: buildModeInput,
549558
originalUserInput: parsedYAML,
550559
tempDir,
551560
codeQLCmd: codeql.getPath(),

0 commit comments

Comments
 (0)