Skip to content

Commit

Permalink
Update for ws prep
Browse files Browse the repository at this point in the history
  • Loading branch information
acampbel committed Mar 1, 2024
1 parent 4197c40 commit 544f828
Show file tree
Hide file tree
Showing 2 changed files with 75 additions and 75 deletions.
70 changes: 35 additions & 35 deletions .github/workflows/matlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,15 @@ on:

env:
PRODUCT_LIST: MATLAB MATLAB_Test MATLAB_Compiler MATLAB_Compiler_SDK
MLM_LICENSE_TOKEN: ${{secrets.MLM_LICENSE_TOKEN}}
# MLM_LICENSE_TOKEN: ${{secrets.MLM_LICENSE_TOKEN}}

jobs:

mex-and-unittests:
# This job will run for all the OS present in the matrix
strategy:
matrix:
os: [ubuntu-latest] #, windows-latest, macos-13] turn off for fast debugging
os: [ubuntu-latest, windows-latest, macos-13]

# The type of runner that the job will run on
runs-on: ${{ matrix.os }}
Expand Down Expand Up @@ -98,36 +98,36 @@ jobs:
path: release/Mass-Spring-Damper.mltbx


deploy-service:
# This job executes only after a successful completion of 'mex-and-unittests' job
needs: mex-and-unittests


runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- name: Setup MATLAB
uses: matlab-actions/setup-matlab@v2-prerelease
with:
release: latest-including-prerelease
cache: true
products: ${{ env.PRODUCT_LIST }}

- name: Download Linux artifacts(to benefit from incremental build)
uses: actions/download-artifact@v4
with:
pattern: build-artifacts-ubuntu-latest
merge-multiple: true

- name: Build the ctf archive and run equivalence integration tests
uses: matlab-actions/run-build@v2
with:
tasks: deploy

- name: Upload Production Server Archive
uses: actions/upload-artifact@v4
with:
name: Mass-Spring-Damper Production Server Archive
path: results/ctf-archive
# deploy-service:
# # This job executes only after a successful completion of 'mex-and-unittests' job
# needs: mex-and-unittests
#
#
# runs-on: ubuntu-latest
#
# steps:
# - uses: actions/checkout@v4
#
# - name: Setup MATLAB
# uses: matlab-actions/setup-matlab@v2-prerelease
# with:
# release: latest-including-prerelease
# cache: true
# products: ${{ env.PRODUCT_LIST }}
#
# - name: Download Linux artifacts(to benefit from incremental build)
# uses: actions/download-artifact@v4
# with:
# pattern: build-artifacts-ubuntu-latest
# merge-multiple: true
#
# - name: Build the ctf archive and run equivalence integration tests
# uses: matlab-actions/run-build@v2
# with:
# tasks: deploy
#
# - name: Upload Production Server Archive
# uses: actions/upload-artifact@v4
# with:
# name: Mass-Spring-Damper Production Server Archive
# path: results/ctf-archive
80 changes: 40 additions & 40 deletions buildfile.m
Original file line number Diff line number Diff line change
Expand Up @@ -75,25 +75,25 @@
Description="Produce a fully qualified toolbox for release");


%% Build a MATLAB Production Server archive
% Ad hoc task, task action defined in toolboxTask local function
plan("ctf").Dependencies = ["lint","test"];
plan("ctf").Inputs = ["code", "pcode", "buildutils/simulateSystemFunctionSignatures.json"];
plan("ctf").Outputs = [...
"results/ctf-archive/MassSpringDamperService.ctf", ...
"results/ctf-build-results.mat", ...
"results/ctf-archive"];


%% Integration tests - back-to-back equivalence tests for the production server archive
plan("ctfIntegTest") = TestTask("integTests/equivalence",SourceFiles=["code","pcode"], ...
Description="Run integration tests against CTF archive.");
plan("ctfIntegTest").Inputs = [plan("ctf").Outputs, "integTests/equivalence"];


%% Create the deploy task - does nothing but depends on other tasks
plan("deploy") = matlab.buildtool.Task(Dependencies="ctfIntegTest", ...
Description="Produce and test a ctf archive to deploy to a MATLAB Production Server");
% %% Build a MATLAB Production Server archive
% % Ad hoc task, task action defined in toolboxTask local function
% plan("ctf").Dependencies = ["lint","test"];
% plan("ctf").Inputs = ["code", "pcode", "buildutils/simulateSystemFunctionSignatures.json"];
% plan("ctf").Outputs = [...
% "results/ctf-archive/MassSpringDamperService.ctf", ...
% "results/ctf-build-results.mat", ...
% "results/ctf-archive"];


% %% Integration tests - back-to-back equivalence tests for the production server archive
% plan("ctfIntegTest") = TestTask("integTests/equivalence",SourceFiles=["code","pcode"], ...
% Description="Run integration tests against CTF archive.");
% plan("ctfIntegTest").Inputs = [plan("ctf").Outputs, "integTests/equivalence"];
%
%
% %% Create the deploy task - does nothing but depends on other tasks
% plan("deploy") = matlab.buildtool.Task(Dependencies="ctfIntegTest", ...
% Description="Produce and test a ctf archive to deploy to a MATLAB Production Server");


%% Produce HTML from workshop live scripts to publish to GitHub pages
Expand Down Expand Up @@ -161,27 +161,27 @@ function toolboxTask(context,version)
end


%% The "ctf" task action
function ctfTask(context)
% Create a deployable archive for MATLAB Production Server

ctfArchive = context.Task.Outputs(1).paths;
ctfBuildResults = context.Task.Outputs(2).paths;

% Create the archive options for the build.
[folder, file] = fileparts(ctfArchive);
opts = compiler.build.ProductionServerArchiveOptions(...
["code/simulateSystem.m", "pcode/springMassDamperDesign.m"], ...
FunctionSignatures="buildutils/simulateSystemFunctionSignatures.json", ...
OutputDir=folder, ...
ArchiveName=file, ...
ObfuscateArchive="on");

% Build the archive
buildResults = compiler.build.productionServerArchive(opts);

save(ctfBuildResults,"buildResults");
end
% %% The "ctf" task action
% function ctfTask(context)
% % Create a deployable archive for MATLAB Production Server
%
% ctfArchive = context.Task.Outputs(1).paths;
% ctfBuildResults = context.Task.Outputs(2).paths;
%
% % Create the archive options for the build.
% [folder, file] = fileparts(ctfArchive);
% opts = compiler.build.ProductionServerArchiveOptions(...
% ["code/simulateSystem.m", "pcode/springMassDamperDesign.m"], ...
% FunctionSignatures="buildutils/simulateSystemFunctionSignatures.json", ...
% OutputDir=folder, ...
% ArchiveName=file, ...
% ObfuscateArchive="on");
%
% % Build the archive
% buildResults = compiler.build.productionServerArchive(opts);
%
% save(ctfBuildResults,"buildResults");
% end


%% The "workshop" task action
Expand Down

0 comments on commit 544f828

Please sign in to comment.