use older runners #72
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI | |
on: | |
push: | |
branches: | |
- master | |
tags: | |
- '*' | |
pull_request: | |
branches: | |
- master | |
jobs: | |
build-mex: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [ubuntu-20.04,windows-2019,macos-12,macos-14] | |
steps: | |
- name: Retrieve the source code | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Install MATLAB | |
uses: matlab-actions/setup-matlab@v2 | |
with: | |
release: ${{ matrix.os == 'macos-14' && 'R2023b' || ( matrix.os == 'windows-2019' && 'R2021b' || 'R2021a' ) }} | |
- name: Build MATLAB MEX files | |
uses: matlab-actions/run-command@v2 | |
with: | |
command: install_sdpt3 -rebuild | |
- name: Run test | |
uses: matlab-actions/run-command@v2 | |
with: | |
command: "install_sdpt3; sqlpdemo -noplot -nopause -exitiferror" | |
- name: Upload MATLAB MEX files | |
uses: actions/upload-artifact@v4 | |
with: | |
name: mexfiles-${{ matrix.os }} | |
path: | | |
Solver/Mexfun/*.mex* | |
build-oct: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [ubuntu-20.04,windows-2019,macos-12,macos-14] | |
steps: | |
- name: Retrieve the source code | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Install Octave | |
shell: bash | |
run: | | |
if [ "${{ matrix.os }}" = ubuntu-latest ]; then | |
sudo apt update | |
sudo apt install --no-install-recommends octave liboctave-dev | |
elif [ "${{ matrix.os }}" = windows-latest ]; then | |
choco install octave.portable | |
else | |
brew install octave | |
fi | |
- name: Build Octave MEX files | |
if: matrix.os != 'windows-latest' | |
run: octave --eval "install_sdpt3 -rebuild" | |
- name: Build Octave MEX files | |
if: matrix.os == 'windows-latest' | |
shell: cmd | |
run: | | |
set PATH=C:\ProgramData\chocolatey\bin;%PATH% | |
which octave-cli.exe | |
octave-cli.exe --no-gui --eval "install_sdpt3 -rebuild" | |
if %errorlevel% neq 0 exit /b %errorlevel% | |
- name: Run test | |
if: matrix.os != 'windows-latest' | |
run: octave --eval "install_sdpt3; sqlpdemo -noplot -nopause -exitiferror" | |
- name: Run test | |
if: matrix.os == 'windows-latest' | |
shell: cmd | |
run: | | |
set PATH=C:\ProgramData\chocolatey\bin;%PATH% | |
octave-cli.exe --no-gui --eval "install_sdpt3; sqlpdemo -noplot -nopause -exitiferror" | |
- name: Upload Octave MEX files | |
uses: actions/upload-artifact@v4 | |
with: | |
name: mexfiles-oct-${{ matrix.os }} | |
path: | | |
Solver/Mexfun/*.mex | |
package: | |
needs: [build-mex,build-oct] | |
runs-on: ubuntu-latest | |
steps: | |
- name: Retrieve the source code | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Retrieve artifacts | |
uses: actions/download-artifact@v4 | |
- name: Move artifacts into place | |
run: | | |
mkdir -p Solver/Mexfun/o_lin && mv mexfiles-oct-ubuntu-latest/* Solver/Mexfun/o_lin/ | |
mkdir -p Solver/Mexfun/o_win && mv mexfiles-oct-windows-latest/* Solver/Mexfun/o_win/ | |
mkdir -p Solver/Mexfun/o_maci && mv mexfiles-oct-macos-latest/* Solver/Mexfun/o_maci/ | |
mkdir -p Solver/Mexfun/o_maca && mv mexfiles-oct-macos-14/* Solver/Mexfun/o_maca/ | |
mv mexfiles-ubuntu-latest/* Solver/Mexfun/ | |
mv mexfiles-windows-latest/* Solver/Mexfun/ | |
mv mexfiles-macos-latest/* Solver/Mexfun/ | |
mv mexfiles-macos-14/* Solver/Mexfun/ | |
rmdir mexfiles-* | |
- name: Show files, build archives | |
run: | | |
cd .. | |
zip -r sdpt3.zip sdpt3 -x 'sdpt3/.git/*' -x 'sdpt3/.github/*' | |
tar cfz sdpt3.tgz --exclude "sdpt3/.git" --exclude "sdpt3/.github" sdpt3 | |
echo "--------" | |
tar tfz sdpt3.tgz | |
echo "--------" | |
zipinfo sdpt3.zip | |
echo "--------" | |
mv sdpt3.tgz sdpt3.zip sdpt3 | |
- name: Upload bundles | |
uses: actions/upload-artifact@v4 | |
with: | |
name: bundles | |
path: | | |
sdpt3.zip | |
sdpt3.tgz | |
- uses: softprops/action-gh-release@v2 | |
if: startsWith(github.ref, 'refs/tags/') | |
with: | |
files: | | |
sdpt3.tgz | |
sdpt3.zip |