-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
github actions update - windows, linux, and cibuildwheel (#38)
* commit * try windows build * try wheels? * action renames * use yum instead of apt * restore action on events * fix tag event action * only for tag events?
- Loading branch information
1 parent
a5894ac
commit ea86b48
Showing
13 changed files
with
184 additions
and
79 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
name: C++ test linux | ||
name: Test bmdscore Linux | ||
|
||
on: | ||
pull_request: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,88 +1,58 @@ | ||
name: Python test windows | ||
name: Test pybmds Windows | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
workflow_dispatch: | ||
|
||
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"] | ||
|
||
runs-on: windows-2022 | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: set up python ${{ matrix.python-version }} | ||
- name: set up Python | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
python-version: "3.12" | ||
cache: pip | ||
- name: set dependency directory | ||
run: echo "DEPENDENCY_DIR=$HOME\github-deps" >> $env:GITHUB_ENV | ||
- name: restore github dependencies from cache | ||
id: cache-github | ||
- name: Set dependency path | ||
shell: bash | ||
run: | | ||
DEP="$GITHUB_WORKSPACE/deps" | ||
echo "DEPENDENCY_DIR=$DEP" >> $GITHUB_ENV | ||
echo "EIGEN_DIR=$DEP\eigen" >> $GITHUB_ENV | ||
echo "NLOPT_DIR=$DEP\nlopt\src\api;$DEP\nlopt\build\Release;$DEP\nlopt\build" >> $GITHUB_ENV | ||
echo "GSL_DIR=$DEP\gsl\build\Release;$DEP\gsl\build" >> $GITHUB_ENV | ||
- name: Restore dependencies from cache | ||
id: cache-dependencies | ||
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 -DBUILD_SHARED_LIBS=OFF .. | ||
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 | ||
key: ${{runner.os}}-cache-dependencies | ||
- name: Build dependencies | ||
if: steps.cache-dependencies.outputs.cache-hit != 'true' | ||
shell: bash | ||
run: tools/windows_ci.sh | ||
- name: Build package | ||
run: | | ||
python -m pip install -U pip wheel | ||
python -m pip install -e ".[dev,docs]" | ||
python -m pip install -e ".[dev]" | ||
stubgen -p pybmds.bmdscore -o src | ||
ruff format src/pybmds/bmdscore.pyi | ||
python setup.py bdist_wheel | ||
python -c "import pybmds; print(pybmds.bmdscore.version())" | ||
- name: Check shared object linked files | ||
run: | | ||
python -m pip install pefile | ||
python -c "from pathlib import Path; import pefile; fn = str(list(Path('src/pybmds').glob('bmdscore*'))[0].resolve()); pe = pefile.PE(fn); print([i.dll for i in pe.DIRECTORY_ENTRY_IMPORT])" | ||
- name: Build package | ||
run: | | ||
python -m pip install -U pip wheel | ||
python setup.py bdist_wheel | ||
- uses: actions/upload-artifact@v4 | ||
with: | ||
path: ./dist/*.whl |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
name: Build Python Packages | ||
|
||
on: | ||
schedule: | ||
- cron: '30 3 1 */1 *' # At 03:30 on the 1st of every month | ||
push: | ||
tags: | ||
- '*' | ||
workflow_dispatch: | ||
|
||
jobs: | ||
|
||
build_wheels: | ||
name: Build wheels on ${{ matrix.os }} | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
matrix: | ||
os: [ubuntu-22.04, windows-2022, macos-14] | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Set up Python | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: "3.12" | ||
- name: Show wheels that will be built | ||
run: | | ||
python -m pip install cibuildwheel==2.18.1 | ||
cibuildwheel --print-build-identifiers | ||
- name: Build wheels | ||
uses: pypa/[email protected] | ||
env: | ||
MACOSX_DEPLOYMENT_TARGET: "14.0" | ||
- uses: actions/upload-artifact@v4 | ||
with: | ||
name: cibw-wheels-${{ matrix.os }}-${{ strategy.job-index }} | ||
path: ./wheelhouse/*.whl | ||
|
||
merge_wheels: | ||
runs-on: ubuntu-22.04 | ||
needs: build_wheels | ||
steps: | ||
- name: Merge Artifacts | ||
uses: actions/upload-artifact/merge@v4 | ||
with: | ||
name: wheels | ||
delete-merged: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
#!/bin/bash | ||
|
||
set -xe | ||
|
||
yum update -y | ||
yum install -y cmake gsl-devel eigen3-devel | ||
|
||
cp ./vendor/nlopt-2.7.1.tar.gz ~ | ||
cd ~ | ||
tar -xf nlopt-2.7.1.tar.gz && cd nlopt-2.7.1 && mkdir build && cd build && cmake -DBUILD_SHARED_LIBS=OFF .. && make install | ||
cd $GITHUB_WORKSPACE |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
#!/bin/bash | ||
|
||
set -xe | ||
|
||
brew install gsl --quiet | ||
brew install nlopt --quiet | ||
brew install eigen --quiet | ||
|
||
cd $GITHUB_WORKSPACE |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
#!/bin/bash | ||
|
||
sudo apt-get update -y | ||
sudo apt-get install -y automake build-essential libtool make cmake libgslcblas0 libgsl-dev libeigen3-dev libnlopt-dev libnlopt-cxx-dev lcov | ||
|
||
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" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
#!/bin/bash | ||
|
||
set -xe | ||
|
||
# only do this first time | ||
DEPS="$GITHUB_WORKSPACE/deps" | ||
if [ -d "$DEPS" ]; then | ||
exit 0 | ||
fi | ||
mkdir -p $DEPS | ||
|
||
# filenames and versions | ||
EIGEN="eigen-3.4.0" | ||
NLOPT="nlopt-2.7.1" | ||
GSL="ampl-gsl-60539d2" | ||
|
||
# eigen | ||
cp $GITHUB_WORKSPACE/vendor/$EIGEN.tar.gz $DEPS | ||
cd $DEPS && tar -xf $EIGEN.tar.gz && mv $EIGEN eigen && rm $EIGEN.tar.gz | ||
|
||
# nlopt | ||
cp $GITHUB_WORKSPACE/vendor/$NLOPT.tar.gz $DEPS | ||
cd $DEPS && tar -xf $NLOPT.tar.gz && mv $NLOPT nlopt && rm $NLOPT.tar.gz | ||
cd nlopt && mkdir build && cd build | ||
cmake -DBUILD_SHARED_LIBS=OFF .. | ||
cmake --build . --config Release | ||
|
||
# gsl | ||
cp $GITHUB_WORKSPACE/vendor/$GSL.tar.gz $DEPS | ||
cd $DEPS && tar -xf $GSL.tar.gz && mv gsl-master gsl && rm $GSL.tar.gz | ||
cd gsl && mkdir build && cd build | ||
cmake -DNO_AMPL_BINDINGS=1 .. | ||
cmake --build . --config Release |
Binary file not shown.