Skip to content

Commit

Permalink
Build for 9e2d7bf
Browse files Browse the repository at this point in the history
  • Loading branch information
Release Action committed Aug 30, 2024
1 parent 9e2d7bf commit 400400d
Show file tree
Hide file tree
Showing 19 changed files with 363 additions and 0 deletions.
Binary file added dist/bin/glnxa64/run-matlab-command
Binary file not shown.
27 changes: 27 additions & 0 deletions dist/bin/license.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
Copyright (c) 2022-2024, The MathWorks, Inc.
All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:

1. Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.

2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.

3. In all cases, the software is, and all modifications and derivatives of the
software shall be, licensed to you solely for use in conjunction with
MathWorks products and service offerings.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Binary file added dist/bin/maca64/run-matlab-command
Binary file not shown.
Binary file added dist/bin/maci64/run-matlab-command
Binary file not shown.
27 changes: 27 additions & 0 deletions dist/bin/thirdpartylicenses.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
Copyright (c) 2013 Google. All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:

* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above
copyright notice, this list of conditions and the following disclaimer
in the documentation and/or other materials provided with the
distribution.
* Neither the name of Google Inc. nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Binary file added dist/bin/win64/run-matlab-command.exe
Binary file not shown.
3 changes: 3 additions & 0 deletions dist/index.js

Large diffs are not rendered by default.

47 changes: 47 additions & 0 deletions dist/plugins/+ciplugins/+github/BuildSummaryPlugin.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
classdef BuildSummaryPlugin < matlab.buildtool.plugins.BuildRunnerPlugin

% Copyright 2024 The MathWorks, Inc.

properties (Access=private)
TaskDetails = {};
end

methods (Access=protected)
function runTaskGraph(plugin, pluginData)
runTaskGraph@matlab.buildtool.plugins.BuildRunnerPlugin(plugin, pluginData);

[fID, msg] = fopen(fullfile(getenv("RUNNER_TEMP") ,"buildSummary" + getenv("GITHUB_RUN_ID") + ".json"), "w");
if fID == -1
warning("ciplugins:github:BuildSummaryPlugin:UnableToOpenFile","Unable to open a file required to create the MATLAB build summary table: %s", msg);
else
closeFile = onCleanup(@()fclose(fID));
s = jsonencode(plugin.TaskDetails);
fprintf(fID, "%s",s);
end
end

function runTask(plugin, pluginData)
runTask@matlab.buildtool.plugins.BuildRunnerPlugin(plugin, pluginData);

taskDetail = getCommonTaskDetail(pluginData);
plugin.TaskDetails = [plugin.TaskDetails, taskDetail];
end

function skipTask(plugin, pluginData)
skipTask@matlab.buildtool.plugins.BuildRunnerPlugin(plugin, pluginData);

taskDetail = getCommonTaskDetail(pluginData);
taskDetail.skipReason = pluginData.SkipReason;
plugin.TaskDetails = [plugin.TaskDetails, taskDetail];
end
end
end

function taskDetail = getCommonTaskDetail(pluginData)
taskDetail = struct();
taskDetail.name = pluginData.TaskResults.Name;
taskDetail.description = pluginData.TaskGraph.Tasks.Description;
taskDetail.failed = pluginData.TaskResults.Failed;
taskDetail.skipped = pluginData.TaskResults.Skipped;
taskDetail.duration = string(pluginData.TaskResults.Duration);
end
22 changes: 22 additions & 0 deletions dist/plugins/+ciplugins/+github/GitHubLogPlugin.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
classdef GitHubLogPlugin < matlab.buildtool.plugins.BuildRunnerPlugin

% Copyright 2024 The MathWorks, Inc.

methods (Access=protected)

function runTask(plugin, pluginData)
% Add Github workflow command for grouping the tasks
disp("::group::" + pluginData.TaskResults.Name);

runTask@matlab.buildtool.plugins.BuildRunnerPlugin(plugin, pluginData);

% Add Github workflow command ::error:: if the task is failed
if pluginData.TaskResults.Failed
disp("::error::" + pluginData.TaskResults.Name + " task failed");
end

% Complete the group command
disp("::endgroup::");
end
end
end
14 changes: 14 additions & 0 deletions dist/plugins/+ciplugins/+github/getDefaultPlugins.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
function plugins = getDefaultPlugins(pluginProviderData)

% Copyright 2024 The MathWorks, Inc.

arguments
pluginProviderData (1,1) struct = struct();
end

plugins = [ ...
matlab.buildtool.internal.getFactoryDefaultPlugins(pluginProviderData) ...
ciplugins.github.GitHubLogPlugin() ...
ciplugins.github.BuildSummaryPlugin() ...
];
end
4 changes: 4 additions & 0 deletions lib/buildSummary.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
export declare function writeSummary(taskSummaryTableRows: string[][]): void;
export declare function getSummaryRows(buildSummary: string): any[];
export declare function interpretSkipReason(skipReason: string): string;
export declare function processAndDisplayBuildSummary(): void;
102 changes: 102 additions & 0 deletions lib/buildSummary.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions lib/buildSummary.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions lib/buildtool.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
export interface RunBuildOptions {
Tasks?: string;
BuildOptions?: string;
}
export declare function generateCommand(options: RunBuildOptions): string;
41 changes: 41 additions & 0 deletions lib/buildtool.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions lib/buildtool.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions lib/index.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export {};
67 changes: 67 additions & 0 deletions lib/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions lib/index.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 400400d

Please sign in to comment.