Skip to content

Commit dd693ff

Browse files
committed
use snap for building
1 parent bc6b7e2 commit dd693ff

File tree

1 file changed

+48
-22
lines changed

1 file changed

+48
-22
lines changed

.github/workflows/ci.yml

+48-22
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 }}
@@ -143,37 +147,59 @@ jobs:
143147
run: |
144148
if [ "${{ matrix.os }}" = ubuntu-latest ]; then
145149
sudo apt update
146-
sudo apt install --no-install-recommends octave snapd flatpak
150+
sudo apt install --no-install-recommends octave
147151
elif [ "${{ matrix.os }}" = windows-latest ]; then
148152
choco install octave.portable
149153
else
150154
brew install octave
151155
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
156+
- name: Run test (Unix)
157+
shell: bash
158+
run: octave --eval "install_sedumi; cd examples; test_sedumi(0, 1)"
159+
- name: Run test (Windows)
156160
if: matrix.os == 'windows-latest'
157161
shell: cmd
158162
run: |
159163
set PATH=C:\ProgramData\chocolatey\bin;%PATH%
160-
octave-cli.exe --no-gui --eval "install_sedumi; cd examples; test_sedumi(1, 1)"
161-
- name: Flatpak
162-
if: matrix.os == 'ubuntu-latest'
164+
octave-cli.exe --no-gui --eval "install_sedumi; cd examples; test_sedumi(0, 1)"
165+
flatpak-test:
166+
needs: package
167+
runs-on: ubuntu-latest
168+
steps:
169+
- name: Retrieve artifact
170+
uses: actions/download-artifact@v4
171+
with:
172+
name: bundles
173+
- name: Unpack artifact
174+
run: tar xfz sedumi.tgz --strip-components=1
175+
- name: Install Flatpak octave
163176
run: |
177+
sudo apt update
178+
sudo apt install flatpak
164179
flatpak remote-add --user --if-not-exists \
165180
flathub https://flathub.org/repo/flathub.flatpakrepo
166181
flatpak install --user -y flathub org.octave.Octave
167-
flatpak run org.octave.Octave --eval "install_sedumi; cd examples; test_sedumi(1, 1)"
168-
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
182+
- name: Run test
183+
shell: bash
184+
run: flatpak run org.octave.Octave --eval "install_sedumi; cd examples; test_sedumi(0, 1)"
185+
snap-test:
186+
needs: package
187+
runs-on: ubuntu-latest
188+
steps:
189+
- name: Retrieve artifact
190+
uses: actions/download-artifact@v4
191+
with:
192+
name: bundles
193+
- name: Unpack artifact
194+
run: tar xfz sedumi.tgz --strip-components=1
195+
- name: Install Flatpak octave
196+
run: |
197+
sudo snap install octave
198+
- name: Run test
199+
shell: bash
200+
run: snap run octave --eval "install_sedumi; cd examples; test_sedumi(0, 1)"
175201
publish:
176-
needs: [matlab-tests,octave-tests]
202+
needs: [matlab-tests,octave-tests,flatpak-test,snap-test]
177203
if: startsWith(github.ref, 'refs/tags/')
178204
runs-on: ubuntu-latest
179205
steps:

0 commit comments

Comments
 (0)