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 9fe52a9
Showing 1 changed file with 44 additions and 22 deletions.
66 changes: 44 additions & 22 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 @@ -143,37 +147,55 @@ jobs:
run: |
if [ "${{ matrix.os }}" = ubuntu-latest ]; then
sudo apt update
sudo apt install --no-install-recommends octave snapd flatpak
sudo apt install --no-install-recommends octave
elif [ "${{ matrix.os }}" = windows-latest ]; then
choco install octave.portable
else
brew install octave
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)"
- name: Flatpak
if: matrix.os == 'ubuntu-latest'
octave-cli.exe --no-gui --eval "install_sedumi; cd examples; test_sedumi(0, 1)"
flatpak-test:
needs: package
runs-on: ubuntu-latest
steps:
- name: Retrieve artifact
uses: actions/download-artifact@v4
with:
name: bundles
- name: Install Flatpak octave
run: |
sudo apt update
sudo apt install flatpak
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 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: Run test
shell: bash
run: flatpak run org.octave.Octave --eval "install_sedumi; cd examples; test_sedumi(0, 1)"
snap-test:
needs: package
runs-on: ubuntu-latest
steps:
- name: Retrieve artifact
uses: actions/download-artifact@v4
with:
name: bundles
- name: Install Flatpak octave
run: |
sudo snap install octave
- name: Run test
shell: bash
run: snap run octave --eval "install_sedumi; cd examples; test_sedumi(0, 1)"
publish:
needs: [matlab-tests,octave-tests]
needs: [matlab-tests,octave-tests,flatpak-test,snap-test]
if: startsWith(github.ref, 'refs/tags/')
runs-on: ubuntu-latest
steps:
Expand Down

0 comments on commit 9fe52a9

Please sign in to comment.