-
Notifications
You must be signed in to change notification settings - Fork 8
150 lines (130 loc) · 4.88 KB
/
linux-build.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
name: linux-build
on:
pull_request:
push:
branches:
- master
tags:
- '*'
jobs:
linux_build:
runs-on: ubuntu-22.04
strategy:
fail-fast: true
matrix:
python-version: ["3.11"]
env:
PYTHON_VERSION: ${{ matrix.python-version }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: 'pip'
- name: Create directory to store installers
run: |
mkdir -p ~/installers
mkdir -p ~/highs
- name: Cache Installers
id: cache-installers-linux
uses: actions/cache@v4
env:
cache-name: cache-installers-linux
with:
path: ~/installers
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('optimizer_version.toml') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
- if: ${{ steps.cache-installers-linux.outputs.cache-hit != 'true' }}
name: Download Installers
run: |
curl -L -o ~/installers/gurobi.tar.gz https://packages.gurobi.com/11.0/gurobi11.0.0_linux64.tar.gz
curl -L -o ~/installers/copt.tar.gz https://pub.shanshu.ai/download/copt/7.0.6/linux64/CardinalOptimizer-7.0.6-lnx64.tar.gz
curl -L -o ~/installers/mosek.tar.bz2 https://download.mosek.com/stable/10.1.22/mosektoolslinux64x86.tar.bz2
- name: Setup Gurobi Installation
env:
GUROBI_WLS: ${{ secrets.GUROBI_WLS }}
run: |
tar xfz ~/installers/gurobi.tar.gz -C ~/
ls ~/gurobi1100/linux64
# set environment variables
export GUROBI_HOME="${HOME}/gurobi1100/linux64"
echo "GUROBI_HOME=${GUROBI_HOME}" >> $GITHUB_ENV
echo "PATH=${PATH}:${GUROBI_HOME}/bin" >> $GITHUB_ENV
echo "LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${GUROBI_HOME}/lib" >> $GITHUB_ENV
echo $GUROBI_HOME
# setup license using secrets
echo "$GUROBI_WLS" > ~/gurobi.lic
echo "GRB_LICENSE_FILE=${HOME}/gurobi.lic" >> $GITHUB_ENV
- name: Test Gurobi
run: |
gurobi_cl
- name: Setup COPT Installation
env:
COPT_CLIENT_INI: ${{ secrets.COPT_CLIENT_INI }}
run: |
tar xfz ~/installers/copt.tar.gz -C ~/
ls ~/copt70
# set environment variables
export COPT_HOME="${HOME}/copt70"
echo "COPT_HOME=${COPT_HOME}" >> $GITHUB_ENV
echo "PATH=${PATH}:${COPT_HOME}/bin" >> $GITHUB_ENV
echo "LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${COPT_HOME}/lib" >> $GITHUB_ENV
echo $COPT_HOME
# setup license using secrets
echo "$COPT_CLIENT_INI" > ~/client.ini
echo "COPT_LICENSE_DIR=${HOME}" >> $GITHUB_ENV
# - name: Test COPT
# run: |
# copt_cmd -c "quit"
- name: Setup MOSEK Installation
env:
MOSEK_LICENSE: ${{ secrets.MOSEK_LICENSE }}
run: |
tar jxf ~/installers/mosek.tar.bz2 -C ~/
ls ~/mosek
# set environment variables
export MOSEK_10_1_BINDIR="${HOME}/mosek/10.1/tools/platform/linux64x86/bin"
echo "MOSEK_10_1_BINDIR=${MOSEK_10_1_BINDIR}" >> $GITHUB_ENV
echo "PATH=${PATH}:${MOSEK_10_1_BINDIR}" >> $GITHUB_ENV
echo "LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${MOSEK_10_1_BINDIR}" >> $GITHUB_ENV
echo $MOSEK_10_1_BINDIR
# setup license using secrets
echo "$MOSEK_LICENSE" > ~/mosek.lic
echo "MOSEKLM_LICENSE_FILE=${HOME}/mosek.lic" >> $GITHUB_ENV
- name: Test MOSEK
run: |
msktestlic
- name: Download HiGHS artifact from my own build
uses: dawidd6/action-download-artifact@v3
with:
# GitHub token, a Personal Access Token with `public_repo` scope
github_token: ${{secrets.GITHUB_TOKEN}}
workflow: build.yml
repo: metab0t/highs_autobuild
path: /home/runner/highs
name: highs-artifact-ubuntu-latest
- name: Setup HiGHS Installation
run: |
ls ~/highs
chmod -R +xr ~/highs
# set environment variables
export HiGHS_HOME="${HOME}/highs"
echo "HiGHS_HOME=${HiGHS_HOME}" >> $GITHUB_ENV
echo "PATH=${PATH}:${HiGHS_HOME}/bin" >> $GITHUB_ENV
echo "LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${HiGHS_HOME}/lib" >> $GITHUB_ENV
echo $HiGHS_HOME
- name: Test HiGHS
run: |
highs --version
- name: Install python deps
run: |
python -m pip install pytest numpy
- name: Build
run: |
python -m pip list
python -m pip install -v .
python -c "import pyoptinterface as poi; print(dir(poi))"
- name: Test
run: |
python -m pytest tests -v -k "not copt"