Skip to content

Commit

Permalink
Better GHA
Browse files Browse the repository at this point in the history
  • Loading branch information
metab0t committed Jan 25, 2024
1 parent 9e963cc commit 36120e9
Show file tree
Hide file tree
Showing 3 changed files with 83 additions and 7 deletions.
87 changes: 81 additions & 6 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,19 +23,94 @@ jobs:

steps:
- uses: actions/checkout@v2
- name: Install Gurobi
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

- name: Install lessmsi
run: |
curl -L -o gurobi.msi https://packages.gurobi.com/11.0/Gurobi-11.0.0-win64.msi
choco install lessmsi
lessmsi x gurobi.msi "D:\"
ls D:\SourceDir
- name: Cache Gurobi Installer
id: cache-gurobi-windows
uses: actions/cache@v3
env:
cache-name: cache-gurobi-windows
with:
path: D:\installers
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('gurobi.msi') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
- if: ${{ steps.cache-gurobi-windows.outputs.cache-hit != 'true' }}
name: Download Gurobi Installer
run: |
curl -L -o D:\installers\gurobi.msi https://packages.gurobi.com/11.0/Gurobi-11.0.0-win64.msi
- name: Setup Gurobi Installation
run: |
lessmsi x D:\installers\gurobi.msi "D:\" gurobi110.dll
lessmsi x D:\installers\gurobi.msi "D:\" gurobi_c.h
lessmsi x D:\installers\gurobi.msi "D:\" gurobi110.lib
ls D:\SourceDir\gurobi1100\win64
# set environment variables
echo "GUROBI_HOME=D:\SourceDir\gurobi1100\win64" >> $env:GITHUB_ENV
echo "PATH=$env:PATH;D:\SourceDir\gurobi1100\win64\bin" >> $env:GITHUB_ENV
# echo "GRB_LICENSE_FILE=C:\gurobi1100\win64\gurobi.lic" >> $env:GITHUB_ENV
echo $env:GUROBI_HOME
- name: Install
- name: Cache COPT Installer
id: cache-copt-windows
uses: actions/cache@v3
env:
cache-name: cache-copt-windows
with:
path: D:\installers
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('copt.zip') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
- if: ${{ steps.cache-copt-windows.outputs.cache-hit != 'true' }}
name: Download COPT Installer
run: |
curl -L -o D:\installers\copt.zip https://pub.shanshu.ai/download/copt/7.0.6/win64/CardinalOptimizer-7.0.6-win64.zip
- name: Setup COPT Installation
run: |
# unzip with 7zip
7z x D:\installers\copt.zip -oD:\
ls D:\copt70
# set environment variables
echo "COPT_HOME=D:\copt70" >> $env:GITHUB_ENV
echo "PATH=$env:PATH;D:\copt70\bin" >> $env:GITHUB_ENV
echo $env:COPT_HOME
- name: Cache MOSEK Installer
id: cache-mosek-windows
uses: actions/cache@v3
env:
cache-name: cache-mosek-windows
with:
path: D:\installers
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('mosek.msi') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
- if: ${{ steps.cache-mosek-windows.outputs.cache-hit != 'true' }}
name: Download MOSEK Installer
run: |
curl -L -o D:\installers\mosek.msi https://download.mosek.com/stable/10.1.22/moseksetupwin64x86.msi
- name: Setup MOSEK Installation
run: |
lessmsi x D:\installers\mosek.msi "D:\" mosek64_10_1.dll mosek64_10_1.lib
lessmsi x D:\installers\mosek.msi "D:\" mosek.h
ls D:\SourceDir\PFiles\Mosek\10.1\tools\platform\win64x86
# set environment variables
echo "MOSEK_10_1_BINDIR=D:\SourceDir\PFiles\Mosek\10.1\tools\platform\win64x86\bin" >> $env:GITHUB_ENV
echo "PATH=$env:PATH;D:\SourceDir\PFiles\Mosek\10.1\tools\platform\win64x86\bin" >> $env:GITHUB_ENV
echo $env:MOSEK_10_1_BINDIR
- name: Install python deps
run: |
python -m pip install build pytest
Expand Down
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ target_include_directories(core PUBLIC include thirdparty)
target_link_libraries(core PUBLIC fmt)

# Build Python extensions
find_package(Python 3.8
find_package(Python ${PYTHON_VERSION}
REQUIRED COMPONENTS Interpreter Development.Module
OPTIONAL_COMPONENTS Development.SABIModule)

Expand Down
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,4 @@ cmake.build-type = "Release"

[tool.scikit-build.cmake.define]
ENABLE_GUROBI_CXX = "OFF"
PYTHON_VERSION = {env="PYTHON_VERSION", default="3.8"}

0 comments on commit 36120e9

Please sign in to comment.