-
Notifications
You must be signed in to change notification settings - Fork 91
86 lines (86 loc) · 2.53 KB
/
ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
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-latest,windows-latest,macos-latest,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-latest' && 'R2021b' || 'R2021a' ) }}
- name: Build MATLAB MEX files
uses: matlab-actions/run-command@v2
with:
command: install_sedumi -rebuild
- name: Run test
uses: matlab-actions/run-command@v2
with:
command: "install_sedumi; cd examples; test_sedumi(1, 1)"
- name: Upload MATLAB MEX files
uses: actions/upload-artifact@v4
with:
name: mexfiles-${{ matrix.os }}
path: *.mex*
build-oct:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest,windows-latest,macos-latest,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_sedumi -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_sedumi -rebuild"
if %errorlevel% neq 0 exit /b %errorlevel%
- name: Run test
if: matrix.os != 'windows-latest'
run: octave --eval "install_sedumi; test_sedumi(1, 1)"
- 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_sedumi; cd examples; test_sedumi(1, 1)"
- name: Upload Octave MEX files
uses: actions/upload-artifact@v4
with:
name: mexfiles-oct-${{ matrix.os }}
path: *.mex