Skip to content

Commit 5ac1aa5

Browse files
authored
Use action artifacts instead of local share folder to add firmware files (#36)
* Try to download artifact from other workflow * Remove local update of firmware. Use artifacts instead. * Update main.yml * Update release.yml * Always assert results success.
1 parent 2e5b796 commit 5ac1aa5

File tree

7 files changed

+29
-37
lines changed

7 files changed

+29
-37
lines changed

.github/workflows/main.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,18 @@ jobs:
7878
path: |
7979
buildUtilities/.buildtool
8080
81+
- name: Download firmware artifact
82+
uses: dawidd6/action-download-artifact@v2
83+
with:
84+
github_token: ${{ secrets.REPO_READ_TOKEN }}
85+
workflow: main.yml
86+
repo: sync2brain/bossdevice-firmware
87+
branch: main
88+
search_artifacts: true
89+
name: bossdevice-firmware-${{ matrix.matlabVer }}
90+
path: toolbox/dependencies/firmware/${{ matrix.matlabVer }}
91+
if_no_artifact_found: fail
92+
8193
- name: Run MATLAB command
8294
run: |
8395
&"$env:ProgramFiles\MATLAB\${{ matrix.matlabVer }}\bin\matlab.exe" -batch "openProject(pwd); cd('buildUtilities'); buildtool test({'noHW','bdConnected'})"

.github/workflows/release.yml

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ on:
1010
- 'v*'
1111

1212
jobs:
13-
package:
13+
packageToolbox:
1414
# The type of runner that the job will run on
1515
runs-on: matlab
1616

@@ -28,6 +28,19 @@ jobs:
2828
path: |
2929
buildUtilities/.buildtool
3030
31+
# Download firmware mldatx file from bossdevice-firmware. Must create a step for every MATLAB release to add
32+
- name: Download R2023a firmware artifact
33+
uses: dawidd6/action-download-artifact@v2
34+
with:
35+
github_token: ${{ secrets.REPO_READ_TOKEN }}
36+
workflow: main.yml
37+
repo: sync2brain/bossdevice-firmware
38+
branch: main
39+
search_artifacts: true
40+
name: bossdevice-firmware-R2023a
41+
path: toolbox/dependencies/firmware
42+
if_no_artifact_found: fail
43+
3144
- name: Run MATLAB command
3245
run: |
3346
&"$env:ProgramFiles\MATLAB\$env:MATLAB_VER\bin\matlab.exe" -batch "openProject(pwd); cd('buildUtilities'); buildtool test('bdConnected') package('${{ github.ref_name }}','${{ github.actor }}')"

buildUtilities/buildfile.m

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,18 +19,13 @@
1919
Actions = @(~) updateSGdeps,...
2020
Outputs = fullfile(projObj.RootFolder,"toolbox/dependencies/sg/**"));
2121

22-
plan("updateFirmwareDeps") = Task( ...
23-
Description = "Update Firmware dependencies", ...
24-
Actions = @(~) updateFirmwareDeps,...
25-
Outputs = fullfile(projObj.RootFolder,"toolbox/dependencies/firmware/**"));
26-
2722
% Create the "test" task and add it to the plan
2823
plan("test") = Task( ...
2924
Description = "Run unit tests", ...
3025
Actions = @(~,tags) testTask(tags),...
3126
Inputs = [fullfile(projObj.RootFolder,'**/*.m'),...
3227
plan("updateSGdeps").Outputs,...
33-
plan("updateFirmwareDeps").Outputs]);
28+
fullfile(projObj.RootFolder,"toolbox/dependencies/firmware/**")]);
3429

3530
plan("buildDoc") = Task( ...
3631
Description = "Build HTML doc from sources", ...
@@ -43,7 +38,7 @@
4338
Description = "Package toolbox", ...
4439
Dependencies = ["check" "test"], ...
4540
Actions = @(~,toolboxVer,authorName) releaseTask(toolboxVer,authorName),...
46-
Inputs = [plan("buildDoc").Outputs, plan("updateSGdeps").Outputs plan("updateFirmwareDeps").Outputs]);
41+
Inputs = [plan("buildDoc").Outputs, plan("updateSGdeps").Outputs fullfile(projObj.RootFolder,"toolbox/dependencies/firmware/**")]);
4742

4843
% Set default tasks in the plan
4944
plan.DefaultTasks = ["check" "test"];

buildUtilities/testTask.m

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,7 @@
3333
runner.addPlugin(XMLPlugin.producingJUnitFormat(fullfile(projObj.RootFolder,'results.xml')));
3434

3535
results = runner.run(suite);
36-
37-
% CI workflows evaluate test success from Test Report
38-
if ~batchStartupOptionUsed
39-
results.assertSuccess;
40-
end
36+
results.assertSuccess;
4137

4238
end
4339

buildUtilities/updateFirmwareDeps.m

Lines changed: 0 additions & 16 deletions
This file was deleted.

resources/project/_BcHeyeYYWxz6MENB98iTz25sSI/nWYhdJ9SIXhKqBMoaMa7pxo7Y9Ud.xml

Lines changed: 0 additions & 6 deletions
This file was deleted.

resources/project/_BcHeyeYYWxz6MENB98iTz25sSI/nWYhdJ9SIXhKqBMoaMa7pxo7Y9Up.xml

Lines changed: 0 additions & 2 deletions
This file was deleted.

0 commit comments

Comments
 (0)