Skip to content

Commit

Permalink
Update parameter name to build-options
Browse files Browse the repository at this point in the history
  • Loading branch information
mw-kapilg committed Jan 25, 2024
1 parent afba191 commit 34606ee
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 11 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/bat.yml
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ jobs:
uses: ./
with:
tasks: deploy
additional-build-options: -skip test
build-options: -skip test

- name: Verify correct tasks appear in buildlog.txt
run: |
Expand All @@ -118,7 +118,7 @@ jobs:
uses: ./
with:
tasks: error deploy
additional-build-options: -continueOnFailure
build-options: -continueOnFailure

- name: Verify correct tasks appear in buildlog.txt
run: |
Expand Down
4 changes: 2 additions & 2 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ inputs:
Space-separated list of tasks to run
required: false
default: ""
additional-build-options:
build-options:
description: >-
Additional build options for MATLAB build tool
Build options for MATLAB build tool
required: false
default: ""
startup-options:
Expand Down
6 changes: 3 additions & 3 deletions src/buildtool.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,16 @@

export interface RunBuildOptions {
Tasks?: string;
AdditionalBuildOptions?: string;
BuildOptions?: string;
}

export function generateCommand(options: RunBuildOptions): string {
let command: string = "buildtool";
if (options.Tasks) {
command = command + " " + options.Tasks;
}
if (options.AdditionalBuildOptions) {
command = command + " " + options.AdditionalBuildOptions + " -ignoreUnknownOptions";
if (options.BuildOptions) {
command = command + " " + options.BuildOptions + " -ignoreUnknownOptions";
}

return command;
Expand Down
6 changes: 3 additions & 3 deletions src/buildtool.unit.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ describe("command generation", () => {
it("buildtool invocation with unspecified tasks and build options", () => {
const options: buildtool.RunBuildOptions = {
Tasks: "",
AdditionalBuildOptions: "",
BuildOptions: "",
};

const actual = buildtool.generateCommand(options);
Expand All @@ -25,7 +25,7 @@ describe("command generation", () => {
it("buildtool invocation with only build options", () => {
const options: buildtool.RunBuildOptions = {
Tasks: "",
AdditionalBuildOptions: "-continueOnFailure -skip check",
BuildOptions: "-continueOnFailure -skip check",
};

const actual = buildtool.generateCommand(options);
Expand All @@ -35,7 +35,7 @@ describe("command generation", () => {
it("buildtool invocation with specified tasks and build options", () => {
const options: buildtool.RunBuildOptions = {
Tasks: "compile test",
AdditionalBuildOptions: "-continueOnFailure -skip check",
BuildOptions: "-continueOnFailure -skip check",
};

const actual = buildtool.generateCommand(options);
Expand Down
2 changes: 1 addition & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ async function run() {

const options: buildtool.RunBuildOptions = {
Tasks: core.getInput("tasks"),
AdditionalBuildOptions: core.getInput("additional-build-options"),
BuildOptions: core.getInput("build-options"),
};

const command = buildtool.generateCommand(options);
Expand Down

0 comments on commit 34606ee

Please sign in to comment.