From 8f337f666030ead5af71433315aca94f8ce8f1c5 Mon Sep 17 00:00:00 2001 From: metab0t Date: Fri, 26 Jan 2024 11:09:27 +0800 Subject: [PATCH] Add GHA test --- .github/workflows/build.yml | 40 +++++++++++++++++++++++++++++++++++-- README.md | 2 -- 2 files changed, 38 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index e77a7d6..ba0a67f 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -30,7 +30,12 @@ jobs: - name: Install lessmsi run: | - choco install lessmsi + curl -L -o D:\lessmsi.zip https://github.com/activescott/lessmsi/releases/download/v1.10.0/lessmsi-v1.10.0.zip + 7z x D:\lessmsi.zip -oD:\lessmsi + echo "PATH=$env:PATH;D:\lessmsi" >> $env:GITHUB_ENV + - name: Test lessmsi + run: | + lessmsi h - name: Create directory to store installers run: | @@ -55,6 +60,8 @@ jobs: curl -L -o D:\installers\mosek.msi https://download.mosek.com/stable/10.1.22/moseksetupwin64x86.msi - name: Setup Gurobi Installation + env: + GUROBI_WLS: ${{ secrets.GUROBI_WLS }} run: | lessmsi x D:\installers\gurobi.msi "D:\" gurobi110.dll lessmsi x D:\installers\gurobi.msi "D:\" gurobi_c.h @@ -64,8 +71,17 @@ jobs: 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 + + # setup license using secrets + echo $env:GUROBI_WLS > D:\gurobi.lic + echo "GRB_LICENSE_FILE=D:\gurobi.lic" >> $env:GITHUB_ENV + - name: Test Gurobi + run: | + gurobi_cl - name: Setup COPT Installation + env: + COPT_CLIENT_INI: ${{ secrets.COPT_CLIENT_INI }} run: | # unzip with 7zip 7z x D:\installers\copt.zip -oD:\ @@ -75,7 +91,16 @@ jobs: echo "PATH=$env:PATH;D:\copt70\bin" >> $env:GITHUB_ENV echo $env:COPT_HOME + # setup license using secrets + echo $env:COPT_CLIENT_INI > D:\client.ini + echo "COPT_LICENSE_DIR=D:\" >> $env:GITHUB_ENV + - name: Test COPT + run: | + copt_cmd + - name: Setup MOSEK Installation + env: + MOSEK_LICENSE: ${{ secrets.MOSEK_LICENSE }} 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 @@ -85,12 +110,23 @@ jobs: echo "PATH=$env:PATH;D:\SourceDir\PFiles\Mosek\10.1\tools\platform\win64x86\bin" >> $env:GITHUB_ENV echo $env:MOSEK_10_1_BINDIR + # setup license using secrets + echo $env:MOSEK_LICENSE > D:\mosek.lic + echo "MOSEKLM_LICENSE_FILE=D:\mosek.lic" >> $env:GITHUB_ENV + - name: Test MOSEK + run: | + msktestlic + - name: Install python deps run: | python -m pip install build pytest - - name: Test + - 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 -v diff --git a/README.md b/README.md index c56b85c..86c3eaf 100644 --- a/README.md +++ b/README.md @@ -5,8 +5,6 @@ PyOptInterface **PyOptInterface** is an open-source Python library to provide a universal API to construct and solve optimization models with various optimizers. -The key feature compared with other - It currently supports the following optimizers: - [Gurobi](https://www.gurobi.com/) - [COPT](https://shanshu.ai/copt)