Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

github action for windows #13

Merged
merged 52 commits into from
May 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
52 commits
Select commit Hold shift + click to select a range
14814da
here
shapiromatron May 8, 2023
4b45b51
setup paths
shapiromatron May 8, 2023
54f87ef
check eigen env
shapiromatron May 8, 2023
3e0e1c2
gsl?
shapiromatron May 8, 2023
e554f48
use built-in?
shapiromatron May 8, 2023
ddf2913
again!
shapiromatron May 8, 2023
10b2778
install nlopt?
shapiromatron May 8, 2023
79ef817
Merge remote-tracking branch 'origin/main' into actions-windows
shapiromatron May 8, 2023
bf7f9ce
try cmake command
shapiromatron May 8, 2023
ae45f0f
install gsl
shapiromatron May 8, 2023
fd3e41e
set some envs
shapiromatron May 8, 2023
6d26714
add eigen
shapiromatron May 8, 2023
001478d
split up deps
shapiromatron May 8, 2023
9f38bfa
updates
shapiromatron May 8, 2023
cdae7a6
update path
shapiromatron May 9, 2023
a9751fd
get both
shapiromatron May 9, 2023
2f0917b
more updates
shapiromatron May 9, 2023
e5fdd65
try conda gsl?
shapiromatron May 9, 2023
bc39afa
try?
shapiromatron May 9, 2023
494689a
enviro variables
shapiromatron May 9, 2023
e164caa
more enviro
shapiromatron May 9, 2023
38d20ff
progress
shapiromatron May 9, 2023
f886b22
conda?
shapiromatron May 9, 2023
5111a47
continue
shapiromatron May 9, 2023
a35dadb
do again
shapiromatron May 9, 2023
48bfcf9
test
shapiromatron May 9, 2023
54169b6
pathfinding
shapiromatron May 9, 2023
341a7f7
use conda?
shapiromatron May 9, 2023
c556cda
more updates
shapiromatron May 9, 2023
6939718
conda env list
shapiromatron Jun 5, 2023
e645427
ls some things
shapiromatron Jun 5, 2023
b2fd7d6
add path variable?
shapiromatron Jun 5, 2023
26700df
Merge remote-tracking branch 'origin/main' into actions-windows
shapiromatron Jun 6, 2023
facf91e
Merge branch 'main' of https://github.com/USEPA/BMDS into actions-win…
munnsmunns Apr 22, 2024
82cf8eb
add msbuild tools
munnsmunns Apr 22, 2024
3c496f4
fix version?
munnsmunns Apr 26, 2024
3589a7e
try cloning gsl instead of anaconda
munnsmunns Apr 30, 2024
95b96b2
change dir to search for each library
munnsmunns May 1, 2024
56b7330
remove versions
munnsmunns May 1, 2024
ac67567
go back to debug gsl
munnsmunns May 1, 2024
8718d66
fix path
munnsmunns May 1, 2024
aff0d78
fix gsl build
munnsmunns May 1, 2024
fa65801
try to cache eigen/nlopt/gsl
munnsmunns May 2, 2024
637d921
adjust syntax
munnsmunns May 2, 2024
5110884
try fixing syntax again
munnsmunns May 2, 2024
88262fb
try different syntax again
munnsmunns May 3, 2024
73cff96
revert to earlier method/fix typo
munnsmunns May 3, 2024
f4eb259
get rid of .. in dependency dir
munnsmunns May 3, 2024
31276a1
set dirs even when cache is hit
munnsmunns May 3, 2024
dc07edd
continue testing
shapiromatron May 7, 2024
5292f39
save pybmds linux wheel
shapiromatron May 7, 2024
77815e0
add back enviro settings
shapiromatron May 7, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 3 additions & 12 deletions .github/workflows/dev-enviro.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,6 @@ name: Developer environment

on:
workflow_dispatch:
# push:
# branches:
# - main

jobs:
test:
Expand All @@ -15,18 +12,12 @@ jobs:
python-version: ["3.11"]
os: [ubuntu-22.04]
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: try to restore pip cache
uses: actions/cache@v3
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('setup.py', 'requirements_dev.txt') }}
restore-keys: |
${{ runner.os }}-pip-
cache: pip
- name: Install dependencies
run: |
python -m pip install -U pip wheel
Expand Down
93 changes: 93 additions & 0 deletions .github/workflows/python-test-windows.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
name: Python test windows

on:
workflow_dispatch:
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-2022"]

steps:
- uses: actions/checkout@v4
- name: set up python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: pip
- 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
- 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
- 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
- name: set eigen/nlopt/gsl directories
run: |
echo "EIGEN_DIR=${{ env.DEPENDENCY_DIR }}\eigen" >> $env:GITHUB_ENV
echo "NLOPT_DIR=${{ env.DEPENDENCY_DIR }}\nlopt\src\api;${{ env.DEPENDENCY_DIR }}\nlopt\build\Release;${{ env.DEPENDENCY_DIR }}\nlopt\build" >> $env:GITHUB_ENV
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: Install dependencies
run: |
python -m pip install -U pip wheel
python -m pip install -r requirements_dev.txt
- name: Build pybmds
run: |
python setup.py develop
python setup.py bdist_wheel
- uses: actions/upload-artifact@v4
with:
path: ./dist/*.whl
21 changes: 11 additions & 10 deletions .github/workflows/python-test.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Python tests
name: Python test linux

on:
workflow_dispatch:
Expand All @@ -16,18 +16,12 @@ jobs:
python-version: ["3.11"]
os: ["ubuntu-22.04"]
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: try to restore pip cache
uses: actions/cache@v3
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('setup.py', 'requirements_dev.txt') }}
restore-keys: |
${{ runner.os }}-pip-
cache: pip
- name: Install dependencies
run: |
python -m pip install -U pip wheel
Expand All @@ -42,3 +36,10 @@ jobs:
- name: Test with pytest
run: |
make test
- name: Build package
run: |
source ./tools/linux_ci.sh
make dist
- uses: actions/upload-artifact@v4
with:
path: ./dist/*.whl
13 changes: 4 additions & 9 deletions .github/workflows/wheels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,11 @@ jobs:
matrix:
os: [ubuntu-22.04, windows-2022, macos-12]
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Build wheels
uses: pypa/cibuildwheel@v2.10.1
uses: pypa/cibuildwheel@v2.17.0
env:
# python311 only
CIBW_BUILD: cp311-*
# no pypy, win32, linux32
CIBW_SKIP: "pp* *-win32 *_i686"
# universal mac wheels
CIBW_ARCHS_MACOS: "universal2"
- uses: actions/upload-artifact@v3
CIBW_BUILD: "cp311-* cp312-* *-macosx_arm64 *-win_amd64 *-manylinux_x86_64"
- uses: actions/upload-artifact@v4
with:
path: ./wheelhouse/*.whl
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ find_library(NLOPT_LIB NAMES NLopt nlopt libnlopt REQUIRED HINTS ${NLOPT_DIR})

project(bmdscore)

include_directories("${CMAKE_SOURCE_DIR}/src/code_base" "${CMAKE_SOURCE_DIR}/src/include" ${EIGEN_DIR} ${NLOPT_DIR}/../include ${GSL_DIR})
include_directories("${CMAKE_SOURCE_DIR}/src/code_base" "${CMAKE_SOURCE_DIR}/src/include" ${EIGEN_DIR} ${NLOPT_DIR}/../include ${NLOPT_DIR} ${GSL_DIR})
link_directories(${GSL_LIB_DIR} ${NLOPT_LIB_DIR})

file (GLOB SOURCE_FILES "${CMAKE_SOURCE_DIR}/src/code_base/*.cpp")
Expand Down
4 changes: 2 additions & 2 deletions tools/linux_ci.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@ export "EIGEN_DIR=/usr/include/eigen3"
export "NLOPT_DIR=/usr/lib/x86_64-linux-gnu/"
export "CMAKE_C_COMPILER=/usr/bin/gcc-12"
export "CMAKE_CXX_COMPILER=/usr/bin/g++-12"
export "PYTHON_EXECUTABLE=/opt/hostedtoolcache/Python/3.11.3/x64/bin/python"
export "PYTHON_LIBRARY_DIR=/opt/hostedtoolcache/Python/3.11.3/x64/lib/python3.11/site-packages"
export "PYTHON_EXECUTABLE=/opt/hostedtoolcache/Python/3.11.9/x64/bin/python"
export "PYTHON_LIBRARY_DIR=/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages"