-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
- Loading branch information
There are no files selected for viewing
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. |
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. |
Large diffs are not rendered by default.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
classdef BuildSummaryPlugin < matlab.buildtool.plugins.BuildRunnerPlugin | ||
|
||
% Copyright 2024 The MathWorks, Inc. | ||
|
||
methods (Access=protected) | ||
|
||
function runTaskGraph(plugin, pluginData) | ||
[email protected](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)); | ||
taskDetails = struct(); | ||
for idx = 1:numel(pluginData.TaskResults) | ||
taskDetails(idx).name = pluginData.TaskResults(idx).Name; | ||
taskDetails(idx).description = pluginData.TaskGraph.Tasks(idx).Description; | ||
taskDetails(idx).failed = pluginData.TaskResults(idx).Failed; | ||
taskDetails(idx).skipped = pluginData.TaskResults(idx).Skipped; | ||
taskDetails(idx).duration = string(pluginData.TaskResults(idx).Duration); | ||
end | ||
s = jsonencode(taskDetails); | ||
fprintf(fID, "%s",s); | ||
end | ||
end | ||
end | ||
end |
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); | ||
|
||
[email protected](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 |
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 |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
export interface Task { | ||
name: string; | ||
description: string; | ||
failed: boolean; | ||
skipped: boolean; | ||
duration: string; | ||
} | ||
export declare function getBuildSummaryTable(tasks: Task[]): string[][]; | ||
export declare function writeSummary(taskSummaryTableRows: string[][]): void; | ||
export declare function processAndDisplayBuildSummary(): void; | ||
export declare function getTaskDetails(tasks: Task): string[]; | ||
export declare function getTaskSummaryRows(task: Task, taskSummaryTableRows: string[][]): string[][]; |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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; |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export {}; |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.