Skip to content

Commit

Permalink
use snap for building
Browse files Browse the repository at this point in the history
  • Loading branch information
mcg1969 committed Apr 13, 2024
1 parent bc6b7e2 commit 54531ea
Showing 1 changed file with 29 additions and 17 deletions.
46 changes: 29 additions & 17 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
- name: Build and test
uses: matlab-actions/run-command@v2
with:
command: "install_sedumi -rebuild; cd examples; test_sedumi(1, 1)"
command: "install_sedumi -rebuild; cd examples; test_sedumi(0, 1)"
- name: Upload MATLAB MEX files
uses: actions/upload-artifact@v4
with:
Expand All @@ -35,6 +35,7 @@ jobs:
build-oct:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-20.04,windows-2019,macos-12,macos-14]
steps:
Expand All @@ -47,21 +48,24 @@ jobs:
run: |
if [ "${{ matrix.os }}" = ubuntu-20.04 ]; then
sudo apt update
sudo apt install --no-install-recommends octave liboctave-dev libopenblas-dev
sudo snap install octave
sudo apt install --no-install-recommends libopenblas-dev
echo "OCTAVE=snap run octave" >>$GITHUB_ENV
elif [ "${{ matrix.os }}" = windows-2019 ]; then
choco install octave.portable
else
brew install octave
echo "OCTAVE=octave" >>$GITHUB_ENV
fi
- name: Build and test (Unix)
if: matrix.os != 'windows-2019'
run: octave --eval "install_sedumi -rebuild; test_sedumi(1, 1)"
run: $OCTAVE --eval "install_sedumi -rebuild; test_sedumi(0, 1)"
- name: Build and test (Windows)
if: matrix.os == 'windows-2019'
shell: cmd
run: |
set PATH=C:\ProgramData\chocolatey\bin;%PATH%
octave-cli.exe --no-gui --eval "install_sedumi -rebuild; test_sedumi(1, 1)"
octave-cli.exe --no-gui --eval "install_sedumi -rebuild; test_sedumi(0, 1)"
if %errorlevel% neq 0 exit /b %errorlevel%
- name: Upload Octave MEX files
uses: actions/upload-artifact@v4
Expand Down Expand Up @@ -123,7 +127,7 @@ jobs:
- name: Run test
uses: matlab-actions/run-command@v2
with:
command: "install_sedumi; cd examples; test_sedumi(1, 1)"
command: "install_sedumi; cd examples; test_sedumi(0, 1)"
octave-tests:
needs: package
runs-on: ${{ matrix.os }}
Expand All @@ -144,34 +148,42 @@ jobs:
if [ "${{ matrix.os }}" = ubuntu-latest ]; then
sudo apt update
sudo apt install --no-install-recommends octave snapd flatpak
echo 'OCTAVE=octave' >>$GITHUB_ENV
elif [ "${{ matrix.os }}" = windows-latest ]; then
choco install octave.portable
echo 'OCTAVE=/c/programdata/choclatey/bin/octave-cli.exe' >>$GITHUB_ENV
else
brew install octave
echo 'OCTAVE=octave' >>$GITHUB_ENV
fi
- name: Run test
if: matrix.os != 'windows-latest'
run: octave --eval "install_sedumi; cd examples; test_sedumi(1, 1)"
- name: Run test
- name: Run test (Unix)
shell: bash
run: octave --eval "install_sedumi; cd examples; test_sedumi(0, 1)"
- name: Run test (Windows)
if: matrix.os == 'windows-latest'
shell: cmd
run: |
set PATH=C:\ProgramData\chocolatey\bin;%PATH%
octave-cli.exe --no-gui --eval "install_sedumi; cd examples; test_sedumi(1, 1)"
octave-cli.exe --no-gui --eval "install_sedumi; cd examples; test_sedumi(0, 1)"
- name: Remove apt Octave
if: matrix.os == 'ubuntu-latest'
run: |
sudo apt remove octave -y
sudo apt autoremove
- name: Flatpak
if: matrix.os == 'ubuntu-latest'
run: |
flatpak remote-add --user --if-not-exists \
flathub https://flathub.org/repo/flathub.flatpakrepo
flatpak install --user -y flathub org.octave.Octave
flatpak run org.octave.Octave --eval "install_sedumi; cd examples; test_sedumi(1, 1)"
flatpak run org.octave.Octave --eval "install_sedumi; cd examples; test_sedumi(0, 1)"
flatpak uninstall --user -y org.octave.Octave
# - name: Snapd
# if: matrix.os == 'ubuntu-latest'
# run: |
# sudo snap install octave
# snap run octave --eval "install_sedumi; cd examples; test_sedumi(1, 1)"
# sudo snap remove octave
- name: Snapd
if: matrix.os == 'ubuntu-latest'
run: |
sudo snap install octave
snap run octave --eval "install_sedumi; cd examples; test_sedumi(0, 1)"
sudo snap remove octave
publish:
needs: [matlab-tests,octave-tests]
if: startsWith(github.ref, 'refs/tags/')
Expand Down

0 comments on commit 54531ea

Please sign in to comment.