Skip to content

Test GHA

Test GHA #22

Workflow file for this run

name: build
on:
pull_request:
push:
branches:
- master
tags:
- '*'
jobs:
windows_build:
runs-on: windows-2022
strategy:
fail-fast: true
matrix:
python-version: ["3.11"]
env:
PYTHON_VERSION: ${{ matrix.python-version }}
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install lessmsi
run: |
choco install lessmsi
- name: Create directory to store installers
run: |
New-Item -ItemType Directory -Force -Path "D:\installers"
- name: Cache Installers
id: cache-installers-windows
uses: actions/cache@v3
env:
cache-name: cache-installers-windows
with:
path: D:\installers
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/*.msi', '**/*.zip') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
- if: ${{ steps.cache-installers-windows.outputs.cache-hit != 'true' }}
name: Download Installers
run: |
curl -L -o D:\installers\gurobi.msi https://packages.gurobi.com/11.0/Gurobi-11.0.0-win64.msi
curl -L -o D:\installers\copt.zip https://pub.shanshu.ai/download/copt/7.0.6/win64/CardinalOptimizer-7.0.6-win64.zip
curl -L -o D:\installers\mosek.msi https://download.mosek.com/stable/10.1.22/moseksetupwin64x86.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 $env:GUROBI_HOME
- 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: 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
- name: Test
run: |
python -m pip list
python -m pip install -v .
python -c "import pyoptinterface as poi; print(dir(poi))"