Skip to content

Commit 54531ea

Browse files
committed
use snap for building
1 parent bc6b7e2 commit 54531ea

File tree

1 file changed

+29
-17
lines changed

1 file changed

+29
-17
lines changed

.github/workflows/ci.yml

Lines changed: 29 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ jobs:
2626
- name: Build and test
2727
uses: matlab-actions/run-command@v2
2828
with:
29-
command: "install_sedumi -rebuild; cd examples; test_sedumi(1, 1)"
29+
command: "install_sedumi -rebuild; cd examples; test_sedumi(0, 1)"
3030
- name: Upload MATLAB MEX files
3131
uses: actions/upload-artifact@v4
3232
with:
@@ -35,6 +35,7 @@ jobs:
3535
build-oct:
3636
runs-on: ${{ matrix.os }}
3737
strategy:
38+
fail-fast: false
3839
matrix:
3940
os: [ubuntu-20.04,windows-2019,macos-12,macos-14]
4041
steps:
@@ -47,21 +48,24 @@ jobs:
4748
run: |
4849
if [ "${{ matrix.os }}" = ubuntu-20.04 ]; then
4950
sudo apt update
50-
sudo apt install --no-install-recommends octave liboctave-dev libopenblas-dev
51+
sudo snap install octave
52+
sudo apt install --no-install-recommends libopenblas-dev
53+
echo "OCTAVE=snap run octave" >>$GITHUB_ENV
5154
elif [ "${{ matrix.os }}" = windows-2019 ]; then
5255
choco install octave.portable
5356
else
5457
brew install octave
58+
echo "OCTAVE=octave" >>$GITHUB_ENV
5559
fi
5660
- name: Build and test (Unix)
5761
if: matrix.os != 'windows-2019'
58-
run: octave --eval "install_sedumi -rebuild; test_sedumi(1, 1)"
62+
run: $OCTAVE --eval "install_sedumi -rebuild; test_sedumi(0, 1)"
5963
- name: Build and test (Windows)
6064
if: matrix.os == 'windows-2019'
6165
shell: cmd
6266
run: |
6367
set PATH=C:\ProgramData\chocolatey\bin;%PATH%
64-
octave-cli.exe --no-gui --eval "install_sedumi -rebuild; test_sedumi(1, 1)"
68+
octave-cli.exe --no-gui --eval "install_sedumi -rebuild; test_sedumi(0, 1)"
6569
if %errorlevel% neq 0 exit /b %errorlevel%
6670
- name: Upload Octave MEX files
6771
uses: actions/upload-artifact@v4
@@ -123,7 +127,7 @@ jobs:
123127
- name: Run test
124128
uses: matlab-actions/run-command@v2
125129
with:
126-
command: "install_sedumi; cd examples; test_sedumi(1, 1)"
130+
command: "install_sedumi; cd examples; test_sedumi(0, 1)"
127131
octave-tests:
128132
needs: package
129133
runs-on: ${{ matrix.os }}
@@ -144,34 +148,42 @@ jobs:
144148
if [ "${{ matrix.os }}" = ubuntu-latest ]; then
145149
sudo apt update
146150
sudo apt install --no-install-recommends octave snapd flatpak
151+
echo 'OCTAVE=octave' >>$GITHUB_ENV
147152
elif [ "${{ matrix.os }}" = windows-latest ]; then
148153
choco install octave.portable
154+
echo 'OCTAVE=/c/programdata/choclatey/bin/octave-cli.exe' >>$GITHUB_ENV
149155
else
150156
brew install octave
157+
echo 'OCTAVE=octave' >>$GITHUB_ENV
151158
fi
152-
- name: Run test
153-
if: matrix.os != 'windows-latest'
154-
run: octave --eval "install_sedumi; cd examples; test_sedumi(1, 1)"
155-
- name: Run test
159+
- name: Run test (Unix)
160+
shell: bash
161+
run: octave --eval "install_sedumi; cd examples; test_sedumi(0, 1)"
162+
- name: Run test (Windows)
156163
if: matrix.os == 'windows-latest'
157164
shell: cmd
158165
run: |
159166
set PATH=C:\ProgramData\chocolatey\bin;%PATH%
160-
octave-cli.exe --no-gui --eval "install_sedumi; cd examples; test_sedumi(1, 1)"
167+
octave-cli.exe --no-gui --eval "install_sedumi; cd examples; test_sedumi(0, 1)"
168+
- name: Remove apt Octave
169+
if: matrix.os == 'ubuntu-latest'
170+
run: |
171+
sudo apt remove octave -y
172+
sudo apt autoremove
161173
- name: Flatpak
162174
if: matrix.os == 'ubuntu-latest'
163175
run: |
164176
flatpak remote-add --user --if-not-exists \
165177
flathub https://flathub.org/repo/flathub.flatpakrepo
166178
flatpak install --user -y flathub org.octave.Octave
167-
flatpak run org.octave.Octave --eval "install_sedumi; cd examples; test_sedumi(1, 1)"
179+
flatpak run org.octave.Octave --eval "install_sedumi; cd examples; test_sedumi(0, 1)"
168180
flatpak uninstall --user -y org.octave.Octave
169-
# - name: Snapd
170-
# if: matrix.os == 'ubuntu-latest'
171-
# run: |
172-
# sudo snap install octave
173-
# snap run octave --eval "install_sedumi; cd examples; test_sedumi(1, 1)"
174-
# sudo snap remove octave
181+
- name: Snapd
182+
if: matrix.os == 'ubuntu-latest'
183+
run: |
184+
sudo snap install octave
185+
snap run octave --eval "install_sedumi; cd examples; test_sedumi(0, 1)"
186+
sudo snap remove octave
175187
publish:
176188
needs: [matlab-tests,octave-tests]
177189
if: startsWith(github.ref, 'refs/tags/')

0 commit comments

Comments
 (0)