diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 76bd58f..a01b33a 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -60,8 +60,10 @@ jobs: strategy: fail-fast: false # Run with every MATLAB version independently matrix: - matlabVer: [R2023a, R2023b] # List of MATLAB releases to test + matlabVer: [R2022b, R2023a, R2023b] # List of MATLAB releases to test + runs-on: matlab + # Steps represent a sequence of tasks that will be executed as part of the job steps: - name: Setup Python @@ -76,12 +78,12 @@ jobs: submodules: 'recursive' token: ${{ secrets.REPO_READ_TOKEN }} - - name: Cache MATLAB build files - uses: actions/cache@v3 - with: - key: matlab-buildtool - path: | - buildUtilities/.buildtool + #- name: Cache MATLAB build files + # uses: actions/cache@v3 + # with: + # key: matlab-buildtool + # path: | + # buildUtilities/.buildtool - name: Download firmware artifact uses: dawidd6/action-download-artifact@v2 @@ -96,8 +98,12 @@ jobs: if_no_artifact_found: fail - name: Run MATLAB command + timeout-minutes: 30 run: | - &"$env:ProgramFiles\MATLAB\${{ matrix.matlabVer }}\bin\matlab.exe" -batch "openProject(pwd); cd('buildUtilities'); buildtool test({'noHW','bdConnected'})" + &"$env:ProgramFiles\MATLAB\${{ matrix.matlabVer }}\bin\matlab.exe" -batch "openProject(pwd); updateSGdeps; testTask({'noHW','bdConnected'});" + # MATLAB R2022b does not support input arguments to buildtool + #run: | + # &"$env:ProgramFiles\MATLAB\${{ matrix.matlabVer }}\bin\matlab.exe" -batch "openProject(pwd); cd('buildUtilities'); buildtool test({'noHW','bdConnected'});" - name: Publish Test Results uses: EnricoMi/publish-unit-test-result-action/composite@v2 @@ -109,6 +115,7 @@ jobs: results.xml - name: Upload Speedgoat dependencies as artifacts + if: ${{ github.ref == 'refs/heads/master' }} uses: actions/upload-artifact@v3 with: name: speedgoat-deps-${{ matrix.matlabVer }} diff --git a/README.md b/README.md index 60dceb4..3faf9d3 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ [![CI](https://github.com/sync2brain/bossdevice-api-matlab/actions/workflows/main.yml/badge.svg)](https://github.com/sync2brain/bossdevice-api-matlab/actions/workflows/main.yml) [![GitHub issues by-label](https://img.shields.io/github/issues-raw/sync2brain/bossdevice-api-matlab/bug)](https://github.com/sync2brain/bossdevice-api-matlab/issues?q=is%3Aissue+is%3Aopen+label%3Abug) ![GitHub](https://img.shields.io/github/license/sync2brain/bossdevice-api-matlab) [![View bossdevice-api-matlab on File Exchange](https://www.mathworks.com/matlabcentral/images/matlab-file-exchange.svg)](https://www.mathworks.com/matlabcentral/fileexchange/133972-bossdevice-api-matlab) [![Open in MATLAB Online](https://www.mathworks.com/images/responsive/global/open-in-matlab-online.svg)](https://matlab.mathworks.com/open/github/v1?repo=sync2brain/bossdevice-api-matlab&project=Bossdeviceapimatlab.prj) ## Requirements -- MATLAB® Supported releases are R2023a and R2023b in their latest update available. +- MATLAB® R2022b or newer in their latest update available. - Simulink Real-Time® - [Simulink Real-Time Target Support Package](https://www.mathworks.com/matlabcentral/fileexchange/76387-simulink-real-time-target-support-package) - [bossdevice](https://sync2brain.com/) hardware diff --git a/buildUtilities/releaseTask.m b/buildUtilities/releaseTask.m index c828906..843049a 100644 --- a/buildUtilities/releaseTask.m +++ b/buildUtilities/releaseTask.m @@ -30,7 +30,7 @@ end toolboxOptions.OutputFile = fullfile(projObj.RootFolder,"releases/bossdevice-api-installer.mltbx"); -toolboxOptions.MinimumMatlabRelease = "R2023a"; +toolboxOptions.MinimumMatlabRelease = "R2022b"; % toolboxOptions.MaximumMatlabRelease = "R2023a"; % Won't limit maximum MATLAB release toolboxOptions.SupportedPlatforms.Glnxa64 = true; toolboxOptions.SupportedPlatforms.Maci64 = false; diff --git a/tests/commonSetupTests.m b/tests/commonSetupTests.m index cdfa975..7464ae3 100644 --- a/tests/commonSetupTests.m +++ b/tests/commonSetupTests.m @@ -17,8 +17,8 @@ function setupBossdevice(testCase) testCase.bd = bossdevice; testCase.bd.targetObject.update; - fprintf('Wait 30s for target to reboot after update and set IP address in secondary interface.\n'); - pause(30); + fprintf('Wait 40s for target to reboot after update and set IP address in secondary interface.\n'); + pause(40); % Set Ethernet IP in secondary interface bossapi.setEthernetInterface(testCase.bd.targetObject,'wm1','192.168.200.255/24'); end @@ -33,9 +33,11 @@ function resetSgPath(testCase) end function rebootTarget(testCase) - disp('Rebooting bossdevice to teardown test class.'); - testCase.bd.targetObject.reboot; - pause(30); + if ~isempty(testCase.bd) + disp('Rebooting bossdevice to teardown test class.'); + testCase.bd.targetObject.reboot; + pause(30); + end end end diff --git a/toolbox/examples/demo_measure_loop_latency.m b/toolbox/examples/demo_measure_loop_latency.m index c360c97..4a63b5c 100644 --- a/toolbox/examples/demo_measure_loop_latency.m +++ b/toolbox/examples/demo_measure_loop_latency.m @@ -10,10 +10,10 @@ bd.start; % Prepare instrument object with signals to stream -inst = slrealtime.Instrument; -inst.addSignal('mainmodel/UDP/Decode UDP Packet',3); % Former UDP/raw_mrk -inst.addSignal('mainmodel/Unit Delay',1); % Former gen_running -bd.addInstrument(inst); +instObj = slrealtime.Instrument; +instObj.addSignal('biosignal','BusElement','mrk'); % Former UDP/raw_mrk +instObj.addSignal('mainmodel/Unit Delay',1); % Former gen_running +bd.addInstrument(instObj); %% Configure scopes in SDI @@ -26,7 +26,7 @@ runObj = Simulink.sdi.Run.getLatest; % Get signal objects and add to subplot -mrkSig = runObj.getSignalsByName('mrk'); +mrkSig = runObj.getSignalsByName('biosignal.mrk'); mrkSig.plotOnSubPlot(1,1,true); genRunSig = runObj.getSignalsByName('gen_running');