1212 build-mex :
1313 runs-on : ${{ matrix.os }}
1414 strategy :
15- fail-fast : false
1615 matrix :
17- os : [ubuntu-latest ,windows-latest ,macos-latest ,macos-14]
16+ os : [ubuntu-20.04 ,windows-2019 ,macos-12 ,macos-14]
1817 steps :
1918 - name : Retrieve the source code
2019 uses : actions/checkout@v4
@@ -23,27 +22,22 @@ jobs:
2322 - name : Install MATLAB
2423 uses : matlab-actions/setup-matlab@v2
2524 with :
26- release : ${{ matrix.os == 'macos-14' && 'R2023b' || ( matrix.os == 'windows-latest ' && 'R2021b' || 'R2021a' ) }}
27- - name : Build MATLAB MEX files
25+ release : ${{ matrix.os == 'macos-14' && 'R2023b' || ( matrix.os == 'windows-2019 ' && 'R2021b' || 'R2021a' ) }}
26+ - name : Build and test
2827 uses : matlab-actions/run-command@v2
2928 with :
30- command : install_sdpt3 -rebuild
31- - name : Run test
32- uses : matlab-actions/run-command@v2
33- with :
34- command : " install_sdpt3; sqlpdemo -noplot -nopause -exitiferror"
29+ command : " install_sdpt3 -rebuild; sqlpdemo -noplot -nopause -exitiferror"
3530 - name : Upload MATLAB MEX files
3631 uses : actions/upload-artifact@v4
3732 with :
38- name : mexfiles -${{ matrix.os }}
33+ name : mex -${{ matrix.os }}
3934 path : |
4035 Solver/Mexfun/*.mex*
4136 build-oct :
4237 runs-on : ${{ matrix.os }}
4338 strategy :
44- fail-fast : false
4539 matrix :
46- os : [ubuntu-latest ,windows-latest ,macos-latest ,macos-14]
40+ os : [ubuntu-20.04 ,windows-2019 ,macos-12 ,macos-14]
4741 steps :
4842 - name : Retrieve the source code
4943 uses : actions/checkout@v4
@@ -52,38 +46,29 @@ jobs:
5246 - name : Install Octave
5347 shell : bash
5448 run : |
55- if [ "${{ matrix.os }}" = ubuntu-latest ]; then
49+ if [ "${{ matrix.os }}" = ubuntu-20.04 ]; then
5650 sudo apt update
5751 sudo apt install --no-install-recommends octave liboctave-dev
58- elif [ "${{ matrix.os }}" = windows-latest ]; then
52+ elif [ "${{ matrix.os }}" = windows-2019 ]; then
5953 choco install octave.portable
6054 else
6155 brew install octave
6256 fi
63- - name : Build Octave MEX files
64- if : matrix.os != 'windows-latest'
65- run : octave --eval "install_sdpt3 -rebuild"
66- - name : Build Octave MEX files
67- if : matrix.os == 'windows-latest'
68- shell : cmd
57+ - name : Build and test (Unix)
58+ if : matrix.os != 'windows-2019'
6959 run : |
70- set PATH=C:\ProgramData\chocolatey\bin;%PATH%
71- which octave-cli.exe
72- octave-cli.exe --no-gui --eval "install_sdpt3 -rebuild"
73- if %errorlevel% neq 0 exit /b %errorlevel%
74- - name : Run test
75- if : matrix.os != 'windows-latest'
76- run : octave --eval "install_sdpt3; sqlpdemo -noplot -nopause -exitiferror"
77- - name : Run test
78- if : matrix.os == 'windows-latest'
60+ octave --eval "install_sdpt3 -rebuild; sqlpdemo -noplot -nopause -exitiferror"
61+ - name : Build and test (Windows)
62+ if : matrix.os == 'windows-2019'
7963 shell : cmd
8064 run : |
8165 set PATH=C:\ProgramData\chocolatey\bin;%PATH%
82- octave-cli.exe --no-gui --eval "install_sdpt3; sqlpdemo -noplot -nopause -exitiferror"
66+ octave-cli.exe --no-gui --eval "install_sdpt3 -rebuild; sqlpdemo -noplot -nopause -exitiferror"
67+ if %errorlevel% neq 0 exit /b %errorlevel%
8368 - name : Upload Octave MEX files
8469 uses : actions/upload-artifact@v4
8570 with :
86- name : mexfiles- oct-${{ matrix.os }}
71+ name : oct-${{ matrix.os }}
8772 path : |
8873 Solver/Mexfun/*.mex
8974 package :
@@ -98,15 +83,12 @@ jobs:
9883 uses : actions/download-artifact@v4
9984 - name : Move artifacts into place
10085 run : |
101- mkdir -p Solver/Mexfun/o_lin && mv mexfiles-oct-ubuntu-latest/* Solver/Mexfun/o_lin/
102- mkdir -p Solver/Mexfun/o_win && mv mexfiles-oct-windows-latest/* Solver/Mexfun/o_win/
103- mkdir -p Solver/Mexfun/o_maci && mv mexfiles-oct-macos-latest/* Solver/Mexfun/o_maci/
104- mkdir -p Solver/Mexfun/o_maca && mv mexfiles-oct-macos-14/* Solver/Mexfun/o_maca/
105- mv mexfiles-ubuntu-latest/* Solver/Mexfun/
106- mv mexfiles-windows-latest/* Solver/Mexfun/
107- mv mexfiles-macos-latest/* Solver/Mexfun/
108- mv mexfiles-macos-14/* Solver/Mexfun/
109- rmdir mexfiles-*
86+ mkdir -p Solver/Mexfun/o_lin && mv oct-ubuntu-*/* Solver/Mexfun/o_lin/
87+ mkdir -p Solver/Mexfun/o_win && mv oct-windows-*/* Solver/Mexfun/o_win/
88+ mkdir -p Solver/Mexfun/o_maci && mv oct-macos-12/* Solver/Mexfun/o_maci/
89+ mkdir -p Solver/Mexfun/o_maca && mv oct-macos-14/* Solver/Mexfun/o_maca/
90+ mv mex-*/* Solver/Mexfun/
91+ rmdir mex-* oct-*
11092 - name : Show files, build archives
11193 run : |
11294 cd ..
@@ -125,8 +107,82 @@ jobs:
125107 path : |
126108 sdpt3.zip
127109 sdpt3.tgz
110+ matlab-tests :
111+ needs : package
112+ runs-on : ${{ matrix.os }}
113+ strategy :
114+ matrix :
115+ os : [ubuntu-latest,macos-latest,windows-latest,macos-14]
116+ steps :
117+ - name : Retrieve artifact
118+ uses : actions/download-artifact@v4
119+ with :
120+ name : bundles
121+ - name : Unpack artifact
122+ run : tar xfz sdpt3.tgz --strip-components=1
123+ - name : Install latest MATLAB
124+ uses : matlab-actions/setup-matlab@v2
125+ - name : Run test
126+ uses : matlab-actions/run-command@v2
127+ with :
128+ command : " install_sdpt3; sqlpdemo -noplot -nopause -exitiferror"
129+ octave-tests :
130+ needs : package
131+ runs-on : ${{ matrix.os }}
132+ strategy :
133+ matrix :
134+ os : [ubuntu-latest,windows-latest,macos-latest,macos-14]
135+ steps :
136+ - name : Retrieve artifact
137+ uses : actions/download-artifact@v4
138+ with :
139+ name : bundles
140+ - name : Unpack artifact
141+ run : tar xfz sdpt3.tgz --strip-components=1
142+ - name : Install Octave, Snap, Flatpak
143+ shell : bash
144+ run : |
145+ if [ "${{ matrix.os }}" = ubuntu-latest ]; then
146+ sudo apt update
147+ sudo apt install --no-install-recommends octave flatpak snapd
148+ elif [ "${{ matrix.os }}" = windows-latest ]; then
149+ choco install octave.portable
150+ else
151+ brew install octave
152+ fi
153+ - name : Run test
154+ if : matrix.os != 'windows-latest'
155+ run : octave --eval "install_sdpt3; sqlpdemo -noplot -nopause -exitiferror"
156+ - name : Run test
157+ if : matrix.os == 'windows-latest'
158+ shell : cmd
159+ run : |
160+ set PATH=C:\ProgramData\chocolatey\bin;%PATH%
161+ octave-cli.exe --no-gui --eval "install_sdpt3; sqlpdemo -noplot -nopause -exitiferror"
162+ - name : Flatpak
163+ if : matrix.os == 'ubuntu-latest'
164+ run : |
165+ flatpak remote-add --user --if-not-exists \
166+ flathub https://flathub.org/repo/flathub.flatpakrepo
167+ flatpak install --user -y flathub org.octave.Octave
168+ flatpak run org.octave.Octave --eval "install_sdpt3; sqlpdemo -noplot -nopause -exitiferror"
169+ flatpak uninstall --user -y org.octave.Octave
170+ - name : Snapd
171+ if : matrix.os == 'ubuntu-latest'
172+ run : |
173+ sudo snap install octave
174+ snap run octave --eval "install_sdpt3; sqlpdemo -noplot -nopause -exitiferror"
175+ sudo snap remove octave
176+ publish :
177+ needs : [matlab-tests,octave-tests]
178+ if : startsWith(github.ref, 'refs/tags/')
179+ runs-on : ubuntu-latest
180+ steps :
181+ - name : Retrieve artifacts
182+ uses : actions/download-artifact@v4
183+ with :
184+ name : bundles
128185 - uses : softprops/action-gh-release@v2
129- if : startsWith(github.ref, 'refs/tags/')
130186 with :
131187 files : |
132188 sdpt3.tgz
0 commit comments