CMake cache #5
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: gh-pages | |
on: | |
push: | |
branches: | |
- master | |
tags: | |
- '*' | |
permissions: | |
contents: write | |
jobs: | |
doc_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 | |
- 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 }}- | |
- name: Cache CMake build | |
id: cache-cmake-linux | |
uses: actions/cache@v4 | |
env: | |
cache-name: cache-cmake-linux | |
with: | |
path: build | |
key: ${{ runner.os }}-cmake-build-${{ env.cache-name }}-${{ hashFiles('CMakeLists.txt') }} | |
- 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: Build | |
run: | | |
python -m pip list | |
python -m pip install -v . | |
python -c "import pyoptinterface as poi; print(dir(poi))" | |
- name: Build documentation | |
run: | | |
pip install -r docs/requirements.txt | |
cd docs | |
make html | |
cd .. | |
- name: Deploy | |
uses: JamesIves/github-pages-deploy-action@v4 | |
with: | |
folder: docs/build/html |