Skip to content

github action for windows #46

github action for windows

github action for windows #46

name: Python windows tests
on:
pull_request:
push:
branches:
- main
env:
PYTHON_LIBRARY_DIR: $Env:CONDA\Lib\site-packages
PYTHON_EXECUTABLE: $Env:CONDA\python.exe
BUILD_TYPE: Release
concurrency:
group: ${{ github.workflow }}-${{ github.ref_name }}
cancel-in-progress: true
jobs:
test:
runs-on: ${{ matrix.os }}
strategy:
max-parallel: 4
matrix:
python-version: ["3.11"]
os: ["windows-latest"]
steps:
- uses: actions/checkout@v4
- name: set up python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: set dependency direcory
run: echo "DEPENDENCY_DIR=$HOME\github-deps" >> $env:GITHUB_ENV
- name: restore github dependencies from cache
id: cache-github
uses: actions/cache@v4
with:
path: ${{ env.DEPENDENCY_DIR }}
key: ${{runner.os}}-github-deps
- name: create dependency dir
if: steps.cache-github.outputs.cache-hit != 'true'
run: mkdir ${{ env.DEPENDENCY_DIR }}
- name: download eigen
if: steps.cache-github.outputs.cache-hit != 'true'
run: |
cd ${{ env.DEPENDENCY_DIR }}
git clone --depth 1 https://github.com/libigl/eigen.git
echo "EIGEN_DIR=${{ env.DEPENDENCY_DIR }}\eigen" >> $env:GITHUB_ENV
- name: install nlopt
if: steps.cache-github.outputs.cache-hit != 'true'
run: |
cd ${{ env.DEPENDENCY_DIR }}
git clone --depth 1 https://github.com/stevengj/nlopt.git
cd nlopt
mkdir build
cd build
cmake ..
cmake --build . --config Release
echo "NLOPT_DIR=${{ env.DEPENDENCY_DIR }}\nlopt\src\api;${{ env.DEPENDENCY_DIR }}\nlopt\build\Release;${{ env.DEPENDENCY_DIR }}\nlopt\build" >> $env:GITHUB_ENV
- name: install gsl
if: steps.cache-github.outputs.cache-hit != 'true'
run: |
cd ${{ env.DEPENDENCY_DIR }}
git clone --depth 1 https://github.com/ampl/gsl.git
cd gsl
mkdir build
cd build
cmake .. -DNO_AMPL_BINDINGS=1
cmake --build . --config Release
echo "GSL_DIR=${{ env.DEPENDENCY_DIR }}\gsl\build\Release;${{ env.DEPENDENCY_DIR }}\gsl\build" >> $env:GITHUB_ENV
- name: build bmds with cmake
shell: pwsh
run: |
mkdir build
cd build
cmake ..
cmake --build . --config Release
# - name: try to restore pip cache
# uses: actions/cache@v4
# with:
# path: ~/.cache/pip
# key: ${{ runner.os }}-pip-${{ hashFiles('setup.py', 'requirements_dev.txt') }}
# restore-keys: |
# ${{ runner.os }}-pip-
# - name: Install dependencies
# run: |
# python -m pip install -U pip wheel
# python -m pip install -r requirements_dev.txt
# - name: Check linting
# run: |
# make lint
# - name: Test with pytest
# run: |
# make test