Skip to content

github action for windows #42

github action for windows

github action for windows #42

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
DEPENDENCY_DIR: $Env:HOME\github-deps
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: restore github dependencies from cache
id: cache-github
uses: actions/cache@v4
with:
path: $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
working-directory: $DEPENDENCY_DIR
if: steps.cache-github.outputs.cache-hit != 'true'
run: |
git clone --depth 1 https://github.com/libigl/eigen.git
echo "$DEPENDENCY_DIR\eigen" >> $env:GITHUB_ENV
- name: install nlopt
working-directory: $DEPENDENCY_DIR
if: steps.cache-github.outputs.cache-hit != 'true'
run: |
git clone --depth 1 https://github.com/stevengj/nlopt.git
cd nlopt
mkdir build
cd build
cmake ..
cmake --build . --config Release
echo "NLOPT_DIR=$DEPENDENCY_DIR\nlopt\src\api;$DEPENDENCY_DIR\nlopt\build\Release;$DEPENDENCY_DIR\nlopt\build" >> $env:GITHUB_ENV
- name: install gsl
working-directory: $DEPENDENCY_DIR
if: steps.cache-github.outputs.cache-hit != 'true'
run: |
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=$DEPENDENCY_DIR\gsl\build\Release;$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