Skip to content

Commit 30b8f51

Browse files
committed
Allow CI with no license
1 parent e8dd4e0 commit 30b8f51

3 files changed

Lines changed: 38 additions & 24 deletions

File tree

.github/actions/setup_optimizers_linux/action.yml

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,18 @@
11
name: "Install optimizers on linux"
22

33
inputs:
4-
GUROBI_WLS:
4+
GUROBI_WLS:
55
description: "..."
6-
required: true
6+
required: false
7+
default: ''
78
COPT_CLIENT_INI:
89
description: "..."
9-
required: true
10+
required: false
11+
default: ''
1012
MOSEK_LICENSE:
1113
description: "..."
12-
required: true
14+
required: false
15+
default: ''
1316
GITHUB_TOKEN:
1417
description: "..."
1518
required: true
@@ -63,7 +66,7 @@ runs:
6366
curl -L -o ~/installers/idaes-solvers.tar.gz https://github.com/IDAES/idaes-ext/releases/download/3.4.2/idaes-solvers-ubuntu2204-aarch64.tar.gz
6467
6568
- name: Setup Gurobi Installation Home
66-
if: ${{ inputs.ARCH == 'X64' }}
69+
if: ${{ (inputs.ARCH == 'X64') && (inputs.GUROBI_WLS != '') }}
6770
shell: bash
6871
run: |
6972
tar xfz ~/installers/gurobi.tar.gz -C ~/
@@ -72,7 +75,7 @@ runs:
7275
export GUROBI_HOME="${HOME}/gurobi1300/linux64"
7376
echo "GUROBI_HOME=${GUROBI_HOME}" >> $GITHUB_ENV
7477
- name: Setup Gurobi Installation Home
75-
if: ${{ inputs.ARCH == 'ARM64' }}
78+
if: ${{ (inputs.ARCH == 'ARM64') && (inputs.GUROBI_WLS != '') }}
7679
shell: bash
7780
run: |
7881
tar xfz ~/installers/gurobi.tar.gz -C ~/
@@ -81,6 +84,7 @@ runs:
8184
export GUROBI_HOME="${HOME}/gurobi1300/armlinux64"
8285
echo "GUROBI_HOME=${GUROBI_HOME}" >> $GITHUB_ENV
8386
- name: Setup Gurobi Installation
87+
if: ${{ inputs.GUROBI_WLS != '' }}
8488
shell: bash
8589
env:
8690
GUROBI_WLS: ${{ inputs.GUROBI_WLS }}
@@ -93,7 +97,7 @@ runs:
9397
echo "$GUROBI_WLS" > ~/gurobi.lic
9498
echo "GRB_LICENSE_FILE=${HOME}/gurobi.lic" >> $GITHUB_ENV
9599
- name: Test Gurobi
96-
if: ${{ inputs.CHECK_LICENSE == 'true' }}
100+
if: ${{ (inputs.CHECK_LICENSE == 'true') && (inputs.GUROBI_WLS != '') }}
97101
shell: bash
98102
run: |
99103
gurobi_cl
@@ -122,7 +126,7 @@ runs:
122126
copt_cmd -c "quit"
123127
124128
- name: Setup MOSEK Installation Env
125-
if: ${{ inputs.ARCH == 'X64' }}
129+
if: ${{ (inputs.ARCH == 'X64') && (inputs.MOSEK_LICENSE != '') }}
126130
shell: bash
127131
run: |
128132
tar jxf ~/installers/mosek.tar.bz2 -C ~/
@@ -131,7 +135,7 @@ runs:
131135
export MOSEK_10_2_BINDIR="${HOME}/mosek/10.2/tools/platform/linux64x86/bin"
132136
echo "MOSEK_10_2_BINDIR=${MOSEK_10_2_BINDIR}" >> $GITHUB_ENV
133137
- name: Setup MOSEK Installation Env
134-
if: ${{ inputs.ARCH == 'ARM64' }}
138+
if: ${{ (inputs.ARCH == 'ARM64') && (inputs.MOSEK_LICENSE != '') }}
135139
shell: bash
136140
run: |
137141
tar jxf ~/installers/mosek.tar.bz2 -C ~/
@@ -140,6 +144,7 @@ runs:
140144
export MOSEK_10_2_BINDIR="${HOME}/mosek/10.2/tools/platform/linuxaarch64/bin"
141145
echo "MOSEK_10_2_BINDIR=${MOSEK_10_2_BINDIR}" >> $GITHUB_ENV
142146
- name: Setup MOSEK Installation
147+
if: ${{ inputs.MOSEK_LICENSE != '' }}
143148
shell: bash
144149
env:
145150
MOSEK_LICENSE: ${{ inputs.MOSEK_LICENSE }}
@@ -152,7 +157,7 @@ runs:
152157
echo "$MOSEK_LICENSE" > ~/mosek.lic
153158
echo "MOSEKLM_LICENSE_FILE=${HOME}/mosek.lic" >> $GITHUB_ENV
154159
- name: Test MOSEK
155-
if: ${{ inputs.CHECK_LICENSE == 'true' }}
160+
if: ${{ (inputs.CHECK_LICENSE == 'true') && (inputs.MOSEK_LICENSE != '') }}
156161
shell: bash
157162
run: |
158163
msktestlic

.github/actions/setup_optimizers_macos/action.yml

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,18 @@
11
name: "Install optimizers on macOS"
22

33
inputs:
4-
GUROBI_WLS:
4+
GUROBI_WLS:
55
description: "..."
6-
required: true
6+
required: false
7+
default: ''
78
COPT_CLIENT_INI:
89
description: "..."
9-
required: true
10+
required: false
11+
default: ''
1012
MOSEK_LICENSE:
1113
description: "..."
12-
required: true
14+
required: false
15+
default: ''
1316
GITHUB_TOKEN:
1417
description: "..."
1518
required: true
@@ -66,6 +69,7 @@ runs:
6669
curl -L -o ~/installers/idaes-solvers.tar.gz https://github.com/IDAES/idaes-ext/releases/download/3.4.2/idaes-solvers-darwin-aarch64.tar.gz
6770
6871
- name: Setup Gurobi Installation
72+
if: ${{ inputs.GUROBI_WLS != '' }}
6973
shell: bash
7074
env:
7175
GUROBI_WLS: ${{ inputs.GUROBI_WLS }}
@@ -84,7 +88,7 @@ runs:
8488
echo "$GUROBI_WLS" > ~/gurobi.lic
8589
echo "GRB_LICENSE_FILE=${HOME}/gurobi.lic" >> $GITHUB_ENV
8690
- name: Test Gurobi
87-
if: ${{ inputs.CHECK_LICENSE == 'true' }}
91+
if: ${{ (inputs.CHECK_LICENSE == 'true') && (inputs.GUROBI_WLS != '') }}
8892
shell: bash
8993
run: |
9094
gurobi_cl
@@ -114,7 +118,7 @@ runs:
114118
copt_cmd -c "quit"
115119
116120
- name: Setup MOSEK X64 Installation
117-
if: ${{ inputs.ARCH == 'X64' }}
121+
if: ${{ (inputs.ARCH == 'X64') && (inputs.MOSEK_LICENSE != '') }}
118122
shell: bash
119123
env:
120124
MOSEK_LICENSE: ${{ inputs.MOSEK_LICENSE }}
@@ -133,7 +137,7 @@ runs:
133137
echo "$MOSEK_LICENSE" > ~/mosek.lic
134138
echo "MOSEKLM_LICENSE_FILE=${HOME}/mosek.lic" >> $GITHUB_ENV
135139
- name: Setup MOSEK ARM64 Installation
136-
if: ${{ inputs.ARCH == 'ARM64' }}
140+
if: ${{ (inputs.ARCH == 'ARM64') && (inputs.MOSEK_LICENSE != '') }}
137141
shell: bash
138142
env:
139143
MOSEK_LICENSE: ${{ inputs.MOSEK_LICENSE }}
@@ -152,7 +156,7 @@ runs:
152156
echo "$MOSEK_LICENSE" > ~/mosek.lic
153157
echo "MOSEKLM_LICENSE_FILE=${HOME}/mosek.lic" >> $GITHUB_ENV
154158
- name: Test MOSEK
155-
if: ${{ inputs.CHECK_LICENSE == 'true' }}
159+
if: ${{ (inputs.CHECK_LICENSE == 'true') && (inputs.MOSEK_LICENSE != '') }}
156160
shell: bash
157161
run: |
158162
msktestlic

.github/actions/setup_optimizers_windows/action.yml

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,18 @@
11
name: "Install optimizers on windows"
22

33
inputs:
4-
GUROBI_WLS:
4+
GUROBI_WLS:
55
description: "..."
6-
required: true
6+
required: false
7+
default: ''
78
COPT_CLIENT_INI:
89
description: "..."
9-
required: true
10+
required: false
11+
default: ''
1012
MOSEK_LICENSE:
1113
description: "..."
12-
required: true
14+
required: false
15+
default: ''
1316
GITHUB_TOKEN:
1417
description: "..."
1518
required: true
@@ -62,6 +65,7 @@ runs:
6265
Get-ChildItem -Path D:\installers
6366
6467
- name: Setup Gurobi Installation
68+
if: ${{ inputs.GUROBI_WLS != '' }}
6569
shell: pwsh
6670
env:
6771
GUROBI_WLS: ${{ inputs.GUROBI_WLS }}
@@ -79,7 +83,7 @@ runs:
7983
echo $env:GUROBI_WLS > D:\gurobi.lic
8084
echo "GRB_LICENSE_FILE=D:\gurobi.lic" >> $env:GITHUB_ENV
8185
- name: Test Gurobi
82-
if: ${{ inputs.CHECK_LICENSE == 'true' }}
86+
if: ${{ (inputs.CHECK_LICENSE == 'true') && (inputs.GUROBI_WLS != '') }}
8387
shell: pwsh
8488
run: |
8589
gurobi_cl
@@ -107,6 +111,7 @@ runs:
107111
copt_cmd -c "quit"
108112
109113
- name: Setup MOSEK Installation
114+
if: ${{ inputs.MOSEK_LICENSE != '' }}
110115
shell: pwsh
111116
env:
112117
MOSEK_LICENSE: ${{ inputs.MOSEK_LICENSE }}
@@ -124,7 +129,7 @@ runs:
124129
echo $env:MOSEK_LICENSE > D:\mosek.lic
125130
echo "MOSEKLM_LICENSE_FILE=D:\mosek.lic" >> $env:GITHUB_ENV
126131
- name: Test MOSEK
127-
if: ${{ inputs.CHECK_LICENSE == 'true' }}
132+
if: ${{ (inputs.CHECK_LICENSE == 'true') && (inputs.MOSEK_LICENSE != '') }}
128133
shell: pwsh
129134
run: |
130135
msktestlic

0 commit comments

Comments
 (0)