-
Notifications
You must be signed in to change notification settings - Fork 152
151 lines (123 loc) · 4.82 KB
/
continuous-integration.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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
name: CI
# controls when action will run
on:
# triggers workflow on push events
push:
# allows workflow to be triggered manually from Actions tab
workflow_dispatch:
jobs:
build:
strategy:
fail-fast: false
matrix:
platform: [octave]
os: [macos-latest, ubuntu-20.04, ubuntu-22.04]
include:
- platform: matlab
os: ubuntu-latest
runs-on: ${{ matrix.os }}
steps:
- name: Check out repository
uses: actions/checkout@v4
- name: Include IPOPT?
if: matrix.platform == 'matlab' || matrix.os != 'ubuntu-16.04'
run: echo "INCLUDE_IPOPT=1" >> $GITHUB_ENV
- name: Include OSQP?
if: matrix.platform == 'matlab' || (matrix.os != 'ubuntu-16.04' && matrix.os != 'ubuntu-18.04')
run: echo "INCLUDE_OSQP=1" >> $GITHUB_ENV
- name: Cache IPOPT Libs (macOS)
if: env.INCLUDE_IPOPT && startsWith(matrix.os, 'macos')
id: cache-ipopt-libs
env:
cache-name: ipopt-libs
uses: actions/cache@v4
with:
path: ~/install
key: ${{ env.cache-name }}-${{ matrix.os }}
- name: Build IPOPT (macOS)
if: env.INCLUDE_IPOPT && startsWith(matrix.os, 'macos') && steps.cache-ipopt-libs.outputs.cache-hit != 'true'
uses: MATPOWER/action-build-ipopt-macos@v1
- name: Cache IPOPT interface
if: env.INCLUDE_IPOPT
id: cache-ipopt
env:
cache-name: ipopt
uses: actions/cache@v4
with:
path: ~/build/ipopt
key: ${{ env.cache-name }}-${{ matrix.platform }}-${{ matrix.os }}
- name: Cache OSQP interface
if: env.INCLUDE_OSQP
id: cache-osqp
env:
cache-name: osqp
uses: actions/cache@v4
with:
path: ~/build/osqp-matlab
key: ${{ env.cache-name }}-${{ matrix.platform }}-${{ matrix.os }}
- name: Install Octave (Linux)
if: matrix.platform == 'octave' && startsWith(matrix.os, 'ubuntu')
uses: MATPOWER/action-install-octave-linux@v1
with:
ipopt-libs: ${{ env.INCLUDE_IPOPT == 1 }}
- name: Install Octave (macOS)
if: matrix.platform == 'octave' && startsWith(matrix.os, 'macos')
uses: MATPOWER/action-install-octave-macos@v1
- name: Install MATLAB
if: matrix.platform == 'matlab'
uses: matlab-actions/setup-matlab@v2
with:
products: Optimization_Toolbox
- name: Configure MATLAB
if: matrix.platform == 'matlab'
uses: MATPOWER/action-configure-matlab@v2
with:
os: ${{ matrix.os }}
ipopt: ${{ env.INCLUDE_IPOPT == 1 }}
ipopt-cached: ${{ steps.cache-ipopt.outputs.cache-hit == 'true' }}
osqp: ${{ env.INCLUDE_OSQP == 1 }}
osqp-cached: ${{ steps.cache-osqp.outputs.cache-hit == 'true' }}
- name: ${{ env.ML_NAME }} ${{ env.ML_VER }} Installed
run: $ML_CMD ver
- name: Install IPOPT interface for Octave
if: env.INCLUDE_IPOPT && matrix.platform == 'octave'
uses: MATPOWER/action-install-ipopt-octave@v1
with:
cached: ${{ steps.cache-ipopt.outputs.cache-hit == 'true' }}
- name: Install OSQP interface for Octave
if: env.INCLUDE_OSQP && matrix.platform == 'octave'
uses: MATPOWER/action-install-osqp-octave@v1
with:
cached: ${{ steps.cache-osqp.outputs.cache-hit == 'true' }}
- name: Install MATPOWER
run: |
$ML_CMD "install_matpower(0,1,1)"
ln -s ./startup.m .octaverc
$ML_CMD mpver
- name: Include MP-Core?
run: |
export HAVE_MP_CORE=`$ML_CMD "fprintf('%d', have_feature('mp_core'))"`
export INCLUDE_MP_CORE=${HAVE_MP_CORE: -1}
echo "INCLUDE_MP_CORE=${INCLUDE_MP_CORE}" >> $GITHUB_ENV
- name: Test GLPK availability, print version number
if: matrix.platform == 'octave'
run: env $ML_PATHVAR=$MP_OPT_MODEL_PATH $ML_CMD "qps_glpk( [],[1; 1],[1 1],[2],[2],[1; 1],[1; 1],[1; 1],struct('verbose', 3)); if ~have_feature('glpk'), exit(1); end"
- name: Test IPOPT availability, print version number
if: env.INCLUDE_IPOPT
run: env $ML_PATHVAR=$MP_OPT_MODEL_PATH $ML_CMD "qps_ipopt([],[1; 1],[1 1],[2],[2],[1; 1],[1; 1],[1; 1],struct('verbose', 2)); if ~have_feature('ipopt'), exit(1); end"
- name: Test OSQP availability, print version number
if: env.INCLUDE_OSQP
run: env $ML_PATHVAR=$MP_OPT_MODEL_PATH $ML_CMD "osqpver; if ~have_feature('osqp'), exit(1); end"
- name: Test MP-Test
run: $ML_CMD "test_mptest(0,1)"
- name: Test MIPS
run: $ML_CMD "test_mips(0,1)"
- name: Test MP-Opt-Model
run: $ML_CMD "test_mp_opt_model(0,1)"
- name: Test MATPOWER (MP_CORE=${{ env.INCLUDE_MP_CORE }})
run: $ML_CMD "test_matpower(0,1)"
- name: Test MOST
run: $ML_CMD "test_most(0,1)"
- name: Test MATPOWER Legacy
if: env.INCLUDE_MP_CORE == '1'
run: $ML_CMD "have_feature('mp_core', 0); test_matpower(0,1)"