diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 89ad468..2b4155e 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -78,6 +78,18 @@ jobs: path: | buildUtilities/.buildtool + - name: Download firmware artifact + uses: dawidd6/action-download-artifact@v2 + with: + github_token: ${{ secrets.REPO_READ_TOKEN }} + workflow: main.yml + repo: sync2brain/bossdevice-firmware + branch: main + search_artifacts: true + name: bossdevice-firmware-${{ matrix.matlabVer }} + path: toolbox/dependencies/firmware/${{ matrix.matlabVer }} + if_no_artifact_found: fail + - name: Run MATLAB command run: | &"$env:ProgramFiles\MATLAB\${{ matrix.matlabVer }}\bin\matlab.exe" -batch "openProject(pwd); cd('buildUtilities'); buildtool test({'noHW','bdConnected'})" diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 6ac7ed5..9292c40 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -10,7 +10,7 @@ on: - 'v*' jobs: - package: + packageToolbox: # The type of runner that the job will run on runs-on: matlab @@ -28,6 +28,19 @@ jobs: path: | buildUtilities/.buildtool + # Download firmware mldatx file from bossdevice-firmware. Must create a step for every MATLAB release to add + - name: Download R2023a firmware artifact + uses: dawidd6/action-download-artifact@v2 + with: + github_token: ${{ secrets.REPO_READ_TOKEN }} + workflow: main.yml + repo: sync2brain/bossdevice-firmware + branch: main + search_artifacts: true + name: bossdevice-firmware-R2023a + path: toolbox/dependencies/firmware + if_no_artifact_found: fail + - name: Run MATLAB command run: | &"$env:ProgramFiles\MATLAB\$env:MATLAB_VER\bin\matlab.exe" -batch "openProject(pwd); cd('buildUtilities'); buildtool test('bdConnected') package('${{ github.ref_name }}','${{ github.actor }}')" diff --git a/buildUtilities/buildfile.m b/buildUtilities/buildfile.m index 5e30b17..5d4a342 100644 --- a/buildUtilities/buildfile.m +++ b/buildUtilities/buildfile.m @@ -19,18 +19,13 @@ Actions = @(~) updateSGdeps,... Outputs = fullfile(projObj.RootFolder,"toolbox/dependencies/sg/**")); -plan("updateFirmwareDeps") = Task( ... - Description = "Update Firmware dependencies", ... - Actions = @(~) updateFirmwareDeps,... - Outputs = fullfile(projObj.RootFolder,"toolbox/dependencies/firmware/**")); - % Create the "test" task and add it to the plan plan("test") = Task( ... Description = "Run unit tests", ... Actions = @(~,tags) testTask(tags),... Inputs = [fullfile(projObj.RootFolder,'**/*.m'),... plan("updateSGdeps").Outputs,... - plan("updateFirmwareDeps").Outputs]); + fullfile(projObj.RootFolder,"toolbox/dependencies/firmware/**")]); plan("buildDoc") = Task( ... Description = "Build HTML doc from sources", ... @@ -43,7 +38,7 @@ Description = "Package toolbox", ... Dependencies = ["check" "test"], ... Actions = @(~,toolboxVer,authorName) releaseTask(toolboxVer,authorName),... - Inputs = [plan("buildDoc").Outputs, plan("updateSGdeps").Outputs plan("updateFirmwareDeps").Outputs]); + Inputs = [plan("buildDoc").Outputs, plan("updateSGdeps").Outputs fullfile(projObj.RootFolder,"toolbox/dependencies/firmware/**")]); % Set default tasks in the plan plan.DefaultTasks = ["check" "test"]; diff --git a/buildUtilities/testTask.m b/buildUtilities/testTask.m index f6c443b..d55f0fe 100644 --- a/buildUtilities/testTask.m +++ b/buildUtilities/testTask.m @@ -33,11 +33,7 @@ runner.addPlugin(XMLPlugin.producingJUnitFormat(fullfile(projObj.RootFolder,'results.xml'))); results = runner.run(suite); - -% CI workflows evaluate test success from Test Report -if ~batchStartupOptionUsed - results.assertSuccess; -end +results.assertSuccess; end diff --git a/buildUtilities/updateFirmwareDeps.m b/buildUtilities/updateFirmwareDeps.m deleted file mode 100644 index fd34ccc..0000000 --- a/buildUtilities/updateFirmwareDeps.m +++ /dev/null @@ -1,16 +0,0 @@ -function updateFirmwareDeps(shareFolder) - -arguments - shareFolder {mustBeFolder} = getenv('firmwareSharePath') -end - -projObj = currentProject; - -% Copy firmware in local share folder to toolbox to facilitate distribution -if ~isempty(shareFolder) - copyfile(shareFolder,fullfile(projObj.RootFolder,'toolbox/dependencies/firmware/')); -else - error('Share folder not found. Firmware dependencies will not be packaged in toolbox.'); -end - -end \ No newline at end of file diff --git a/resources/project/_BcHeyeYYWxz6MENB98iTz25sSI/nWYhdJ9SIXhKqBMoaMa7pxo7Y9Ud.xml b/resources/project/_BcHeyeYYWxz6MENB98iTz25sSI/nWYhdJ9SIXhKqBMoaMa7pxo7Y9Ud.xml deleted file mode 100644 index 7a6326b..0000000 --- a/resources/project/_BcHeyeYYWxz6MENB98iTz25sSI/nWYhdJ9SIXhKqBMoaMa7pxo7Y9Ud.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - \ No newline at end of file diff --git a/resources/project/_BcHeyeYYWxz6MENB98iTz25sSI/nWYhdJ9SIXhKqBMoaMa7pxo7Y9Up.xml b/resources/project/_BcHeyeYYWxz6MENB98iTz25sSI/nWYhdJ9SIXhKqBMoaMa7pxo7Y9Up.xml deleted file mode 100644 index 6f1dbc0..0000000 --- a/resources/project/_BcHeyeYYWxz6MENB98iTz25sSI/nWYhdJ9SIXhKqBMoaMa7pxo7Y9Up.xml +++ /dev/null @@ -1,2 +0,0 @@ - - \ No newline at end of file