-
Notifications
You must be signed in to change notification settings - Fork 2
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 actions update - windows, linux, and cibuildwheel #38
Merged
Merged
Changes from 6 commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
f81cf1b
commit
shapiromatron c94d1e7
try windows build
shapiromatron 1627758
try wheels?
shapiromatron b5d5aa9
action renames
shapiromatron a205f19
use yum instead of apt
shapiromatron e2cd1b4
restore action on events
shapiromatron 0cc5434
fix tag event action
shapiromatron d0170b2
only for tag events?
shapiromatron File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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,44 @@ | ||
name: Build Python Packages | ||
|
||
on: | ||
schedule: | ||
- cron: '30 3 1 */1 *' # At 03:30 on the 1st of every month | ||
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.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@cwsimmon I removed this; it doesn't appear to be needed?