@@ -11,53 +11,70 @@ concurrency:
1111 cancel-in-progress : true
1212
1313jobs :
14- test :
14+ build_cpp :
15+ runs-on : Linux
16+ steps :
17+ - name : Checkout RAT
18+ uses : actions/checkout@v5
19+ - name : Generate CPP
20+ uses : matlab-actions/run-command@v2
21+ with :
22+ command : addPaths; generateCpps;
23+ - name : Upload cppDeploy
24+ uses : actions/upload-artifact@v4
25+ with :
26+ name : cppDeploy
27+ retention-days : 1
28+ path : compile/fullCompile/cppDeploy/
29+ - name : Upload cppDeploy
30+ uses : actions/upload-artifact@v4
31+ with :
32+ name : codegen
33+ retention-days : 1
34+ path : compile/fullCompile/codegen/
35+
36+ build_and_test_mex :
1537 strategy :
1638 matrix :
17- platform : [Windows, Linux, macOS ]
39+ platform : [windows-latest, ubuntu-latest, macos-15-intel, macos-latest ]
1840 runs-on : ${{ matrix.platform }}
41+ needs : [build_cpp]
1942
2043 steps :
2144 - name : Checkout RAT
22- uses : actions/checkout@v4
23- - name : Build Mex
24- uses : matlab-actions/run-command@v2
45+ uses : actions/checkout@v5
46+ - name : Download Mex CPP
47+ uses : actions/download-artifact@v4
48+ with :
49+ name : codegen
50+ path : compile/fullCompile/codegen/
51+ - name : Set up MATLAB
52+ uses : matlab-actions/setup-matlab@v2
2553 with :
26- command : buildScript
27- - name : Run tests
54+ release : R2023a
55+ products : Parallel_Computing_Toolbox
56+ - name : Build Mex and Run Tests
2857 uses : matlab-actions/run-command@v2
2958 with :
30- command : testScript
59+ command : addPaths; generateMexFromCpp; testScript
3160 - name : Create build archive (Windows and macOS)
3261 if : runner.os != 'Linux'
33- run : tar --exclude="**/-lang:c++.zip" --exclude=".git*/" --exclude="htmlcov/" -acvf ../${{ runner.os }}.zip *
62+ run : tar --exclude="**/-lang:c++.zip" --exclude=".git*/" --exclude="**/codegen/" --exclude=" htmlcov/" -acvf ../${{ runner.os }}-${{ runner.arch }}.zip *
3463 - name : Create build archive (Linux)
3564 if : runner.os == 'Linux'
36- run : zip -r ../${{ runner.os }}. zip * -x "**/-lang:c++.zip" ".git*/" "htmlcov/*"
37- - run : mv ../${{ runner.os }}. zip ${{ runner.os }}.zip
65+ run : zip -r ../${{ runner.os }}-${{ runner.arch }}. zip * -x "**/-lang:c++.zip" ".git*/" "htmlcov/*" "**/codegen /*"
66+ - run : mv ../${{ runner.os }}-${{ runner.arch }}. zip ${{ runner.os }}-${{ runner.arch }}.zip
3867 - name : Upload releases
3968 uses : actions/upload-artifact@v4
4069 with :
41- name : ${{ runner.os }}
42- retention-days : 1
43- path : ${{ runner.os }}.zip
44- - name : Create cppDeploy
45- if : runner.os == 'Linux'
46- uses : matlab-actions/run-command@v2
47- with :
48- command : cppDeploy
49- - name : Upload cppDeploy
50- if : runner.os == 'Linux'
51- uses : actions/upload-artifact@v4
52- with :
53- name : cppDeploy
70+ name : ${{ runner.os }}-${{ runner.arch }}
5471 retention-days : 1
55- path : compile/fullCompile/cppDeploy/
72+ path : ${{ runner.os }}-${{ runner.arch }}.zip
5673
5774 deploy-nightly :
5875 if : github.ref == 'refs/heads/master'
5976 runs-on : ubuntu-latest
60- needs : [test ]
77+ needs : [build_and_test_mex ]
6178 permissions :
6279 contents : write
6380 steps :
@@ -68,17 +85,17 @@ jobs:
6885 - name : Create nightly release
6986 run : |
7087 output=$(gh release delete nightly --cleanup-tag --yes --repo ${{ github.repository }} 2>&1) || [[ "${output}" == "release not found" ]]
71- gh release create nightly Windows.zip Linux.zip macOS.zip --prerelease --title "Nightly Build" --latest=false --repo ${{ github.repository }}
88+ gh release create nightly Windows-X64 .zip Linux-X64 .zip macOS-X64.zip macOS-ARM64 .zip --prerelease --title "Nightly Build" --latest=false --repo ${{ github.repository }}
7289 env :
7390 GH_TOKEN : ${{ github.token }}
7491
7592 cpp-deploy :
7693 if : github.ref == 'refs/heads/master'
7794 runs-on : ubuntu-latest
78- needs : [test ]
95+ needs : [build_and_test_mex ]
7996 steps :
8097 - name : Checkout Source
81- uses : actions/checkout@v4
98+ uses : actions/checkout@v5
8299 with :
83100 ref : generated_source
84101 path : rat_source
96113 git config user.email github-actions@github.com
97114 git add -A
98115 git commit -m "Deploy Source Code" || true
99- git push
116+ git push
0 commit comments