Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions .github/workflows/bat.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,20 +34,28 @@ jobs:

- name: Perform 'setup-matlab'
uses: matlab-actions/setup-matlab@v2
with:
products: MATLAB_Test

- name: Create buildfile.m in project root for tests
shell: bash
run: |
cat <<'_EOF' >> "buildfile.m"
function plan = buildfile
import matlab.buildtool.tasks.TestTask

plan = buildplan(localfunctions);
plan("preMadeTest") = TestTask;
plan("preMadeTest").Dependencies = "build";
plan("test").Dependencies = "build";
plan("deploy").Dependencies = "test";

plan.DefaultTasks = "test";
end

function buildTask(~)
f = fopen('buildlog.txt', 'a+'); fprintf(f, 'building\n'); fclose(f);
end

function testTask(~,tests,options)
arguments
Expand All @@ -60,16 +68,20 @@ jobs:
fprintf(f, '%s\n', tests);
fprintf(f, '%s\n', options.OutputDetail);
fclose(f);
end

function deployTask(~)
f = fopen('buildlog.txt', 'a+'); fprintf(f, 'deploying\n'); fclose(f);
end

function checkTask(~)
f = fopen('buildlog.txt', 'a+'); fprintf(f, 'checking\n'); fclose(f);
end

function errorTask(~)
f = fopen('buildlog.txt', 'a+'); fprintf(f, 'erroring\n'); fclose(f);
error('Error occured in errorTask');
end
_EOF

- name: Run build with default tasks
Expand Down Expand Up @@ -213,6 +225,11 @@ jobs:
grep "::error::error task failed" console.log
rm console.log

- name: Run build with premade TestTask for test summary
uses: ./
with:
tasks: preMadeTest

- name: Run build with invalid task
continue-on-error: true
uses: ./
Expand Down
1 change: 0 additions & 1 deletion .npmrc

This file was deleted.

1,008 changes: 502 additions & 506 deletions package-lock.json

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,15 @@
"package": "ncc build --minify",
"test": "jest",
"all": "npm test && npm run build && npm run package",
"ci": "npm run clean && npm run deps && npm ci && npm run all"
"ci": "npm run clean && npm ci && npm run deps && npm run all"
},
"files": [
"lib/"
],
"dependencies": {
"@actions/core": "^1.11.1",
"@actions/exec": "^1.1.1",
"run-matlab-command-action": "github:matlab-actions/run-command#v2.3.0"
"common-utils": "github:matlab-actions/common-utils#v1.0.0"
},
"devDependencies": {
"@types/jest": "^30.0.0",
Expand Down
47 changes: 0 additions & 47 deletions plugins/+ciplugins/+github/BuildSummaryPlugin.m

This file was deleted.

22 changes: 0 additions & 22 deletions plugins/+ciplugins/+github/GitHubLogPlugin.m

This file was deleted.

70 changes: 0 additions & 70 deletions plugins/+ciplugins/+github/ParallelizableBuildSummaryPlugin.m

This file was deleted.

20 changes: 0 additions & 20 deletions plugins/+ciplugins/+github/getDefaultPlugins.m

This file was deleted.

8 changes: 8 additions & 0 deletions sample/TheTruth.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
classdef TheTruth < matlab.unittest.TestCase
methods (Test)
function testTheTestOfAllTime(testCase)
onetyone = 11;
testCase.verifyEqual(onetyone, 11);
end
end
end
32 changes: 3 additions & 29 deletions scripts/setupdeps.sh
Original file line number Diff line number Diff line change
@@ -1,32 +1,6 @@
#!/bin/bash

RMC_BASE_URL='https://ssd.mathworks.com/supportfiles/ci/run-matlab-command/v2'
SUPPORTED_OS=('win64' 'maci64' 'maca64' 'glnxa64')
source ./node_modules/common-utils/scripts/setupdeps.sh

# Create dist directory if it doesn't already exist
DISTDIR="$(pwd)/dist/bin"
mkdir -p $DISTDIR

# Create plugin directory and copy plugin code
cp -R plugins $(pwd)/dist/

# Download and extract in a temporary directory
WORKINGDIR=$(mktemp -d -t rmc_build.XXXXXX)
cd $WORKINGDIR

wget -O "$WORKINGDIR/license.txt" "$RMC_BASE_URL/license.txt"
wget -O "$WORKINGDIR/thirdpartylicenses.txt" "$RMC_BASE_URL/thirdpartylicenses.txt"

for os in ${SUPPORTED_OS[@]}
do
if [[ $os == 'win64' ]] ; then
bin_ext='.exe'
else
bin_ext=''
fi
mkdir -p "$WORKINGDIR/$os"
wget -O "$WORKINGDIR/$os/run-matlab-command$bin_ext" "$RMC_BASE_URL/$os/run-matlab-command$bin_ext"
done

mv -f ./* "$DISTDIR/"
rm -rf $WORKINGDIR
mv -f ./* "$DISTDIR/bin"
rm -rf $WORKINGDIR
69 changes: 0 additions & 69 deletions src/buildSummary.ts

This file was deleted.

Loading
Loading