-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Loading status checks…
Import 'pybind11' instead running of a subprocess
Showing
2 changed files
with
158 additions
and
195 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 |
---|---|---|
|
@@ -4,40 +4,18 @@ on: | |
branches: | ||
- topics/test-gha | ||
jobs: | ||
make-source-dist: | ||
runs-on: ubuntu-20.04 | ||
steps: | ||
- name: Install dependencies | ||
run: pip3 install build twine | ||
|
||
- name: Get the code | ||
uses: actions/checkout@v4 | ||
|
||
- name: Build the source distribution | ||
run: python3 -m build --sdist | ||
- name: Check the source distribution | ||
run: twine check dist/* | ||
|
||
- name: Upload the source distribution to GitHub Actions artifacts | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: source-dist | ||
path: dist | ||
|
||
build-for-linux: | ||
runs-on: ubuntu-20.04 | ||
needs: | ||
- make-source-dist | ||
strategy: | ||
matrix: | ||
python_version: ['3.8', '3.12'] | ||
python_version: ['3.8'] | ||
steps: | ||
- name: Install Python | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: ${{ matrix.python_version }} | ||
- name: Install Python packages | ||
run: pip${{ matrix.python_version }} install auditwheel build Chrones pybind11 twine | ||
run: pip${{ matrix.python_version }} install auditwheel build Chrones pybind11 twine wheel | ||
- name: Install CUDA | ||
run: | | ||
sudo apt-key adv --fetch-keys https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64/3bf863cc.pub | ||
|
@@ -77,17 +55,11 @@ jobs: | |
tar xf *.tar.gz | ||
sudo cp bin/patchelf /usr/local/bin | ||
- name: Dowload the source distribution from GitHub Actions artifacts | ||
uses: actions/download-artifact@v4 | ||
with: | ||
name: source-dist | ||
- name: Unzip the source distribution | ||
run: | | ||
tar xf *.tar.gz | ||
rm *.tar.gz | ||
- name: Get the code | ||
uses: actions/checkout@v4 | ||
|
||
- name: Build the wheel | ||
run: python${{ matrix.python_version }} -m build --wheel --outdir local-dist lincs-* | ||
run: python${{ matrix.python_version }} -m build --no-isolation --wheel --outdir local-dist | ||
env: | ||
LINCS_DEV_FORCE_NVCC: "true" | ||
LINCS_DEV_FORCE_CHRONES: "true" | ||
|
@@ -96,164 +68,158 @@ jobs: | |
- name: Check the wheel | ||
run: twine check dist/*.whl | ||
|
||
- name: Upload the wheel to GitHub Actions artifacts | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: wheel-dist-${{ matrix.python_version }}-linux | ||
path: dist | ||
|
||
build-for-windows: | ||
runs-on: windows-2019 | ||
needs: | ||
- build-for-linux | ||
strategy: | ||
matrix: | ||
python_version: ['3.8', '3.12'] | ||
steps: | ||
- name: Install Python | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: ${{ matrix.python_version }} | ||
- name: Install Python packages | ||
run: pip install build delvewheel pybind11 twine | ||
- name: Install CUDA | ||
uses: Jimver/[email protected] | ||
id: cuda-toolkit | ||
with: | ||
cuda: '12.1.0' | ||
use-github-cache: false | ||
use-local-cache: false | ||
method: network | ||
# Package names from https://docs.nvidia.com/cuda/cuda-installation-guide-microsoft-windows/index.html#id2 | ||
sub-packages: '["nvcc", "cudart"]' | ||
- name: Install MSys2 | ||
uses: msys2/setup-msys2@v2 | ||
with: | ||
update: true | ||
msystem: UCRT64 | ||
install: >- | ||
gzip | ||
tar | ||
unzip | ||
wget | ||
- name: Install boost | ||
shell: msys2 {0} | ||
run: | | ||
cd /d/a | ||
wget https://boostorg.jfrog.io/artifactory/main/release/1.82.0/source/boost_1_82_0.tar.gz | ||
tar xf boost_*.tar.gz | ||
rm boost_*.tar.gz | ||
mv boost_* boost | ||
cd boost | ||
echo "using python : ${{ matrix.python_version }} ;" >tools/build/src/user-config.jam | ||
./bootstrap.bat | ||
./b2 --with-python python=${{ matrix.python_version }} link=shared variant=release stage || true | ||
mkdir -p /d/lincs-deps/include /d/lincs-deps/lib | ||
cp -r boost /d/lincs-deps/include | ||
cp -r stage/lib/* /d/lincs-deps/lib | ||
- name: Install OR-Tools | ||
shell: msys2 {0} | ||
run: | | ||
cd /d/a | ||
wget https://github.com/google/or-tools/releases/download/v8.2/or-tools_VisualStudio2019-64bit_v8.2.8710.zip | ||
unzip or-tools_*.zip | ||
rm or-tools_*.zip | ||
cd or-tools_* | ||
cp -r include/* /d/lincs-deps/include | ||
cp -r lib/* /d/lincs-deps/lib | ||
# build-for-windows: | ||
# runs-on: windows-2019 | ||
# needs: | ||
# - build-for-linux | ||
# strategy: | ||
# matrix: | ||
# python_version: ['3.8', '3.12'] | ||
# steps: | ||
# - name: Install Python | ||
# uses: actions/setup-python@v5 | ||
# with: | ||
# python-version: ${{ matrix.python_version }} | ||
# - name: Install Python packages | ||
# run: pip install build delvewheel pybind11 twine | ||
# - name: Install CUDA | ||
# uses: Jimver/[email protected] | ||
# id: cuda-toolkit | ||
# with: | ||
# cuda: '12.1.0' | ||
# use-github-cache: false | ||
# use-local-cache: false | ||
# method: network | ||
# # Package names from https://docs.nvidia.com/cuda/cuda-installation-guide-microsoft-windows/index.html#id2 | ||
# sub-packages: '["nvcc", "cudart"]' | ||
# - name: Install MSys2 | ||
# uses: msys2/setup-msys2@v2 | ||
# with: | ||
# update: true | ||
# msystem: UCRT64 | ||
# install: >- | ||
# gzip | ||
# tar | ||
# unzip | ||
# wget | ||
# - name: Install boost | ||
# shell: msys2 {0} | ||
# run: | | ||
# cd /d/a | ||
# wget https://boostorg.jfrog.io/artifactory/main/release/1.82.0/source/boost_1_82_0.tar.gz | ||
# tar xf boost_*.tar.gz | ||
# rm boost_*.tar.gz | ||
# mv boost_* boost | ||
# cd boost | ||
# echo "using python : ${{ matrix.python_version }} ;" >tools/build/src/user-config.jam | ||
# ./bootstrap.bat | ||
# ./b2 --with-python python=${{ matrix.python_version }} link=shared variant=release stage || true | ||
# mkdir -p /d/lincs-deps/include /d/lincs-deps/lib | ||
# cp -r boost /d/lincs-deps/include | ||
# cp -r stage/lib/* /d/lincs-deps/lib | ||
# - name: Install OR-Tools | ||
# shell: msys2 {0} | ||
# run: | | ||
# cd /d/a | ||
# wget https://github.com/google/or-tools/releases/download/v8.2/or-tools_VisualStudio2019-64bit_v8.2.8710.zip | ||
# unzip or-tools_*.zip | ||
# rm or-tools_*.zip | ||
# cd or-tools_* | ||
# cp -r include/* /d/lincs-deps/include | ||
# cp -r lib/* /d/lincs-deps/lib | ||
|
||
- name: Dowload the source distribution from GitHub Actions artifacts | ||
uses: actions/download-artifact@v4 | ||
with: | ||
name: source-dist | ||
- name: Unzip the source distribution | ||
shell: msys2 {0} | ||
run: | | ||
tar xf *.tar.gz | ||
rm *.tar.gz | ||
# - name: Dowload the source distribution from GitHub Actions artifacts | ||
# uses: actions/download-artifact@v4 | ||
# with: | ||
# name: source-dist | ||
# - name: Unzip the source distribution | ||
# shell: msys2 {0} | ||
# run: | | ||
# tar xf *.tar.gz | ||
# rm *.tar.gz | ||
|
||
- name: Build the wheel | ||
run: python -m build --wheel --outdir local-dist (get-item lincs-*) | ||
env: | ||
LINCS_DEV_FORCE_NVCC: "true" | ||
LINCS_DEV_DEPENDENCIES: d:\lincs-deps | ||
LINCS_DEV_VC_VERSION: 142 | ||
- name: Make the wheel machine-independent | ||
run: delvewheel repair --strip (get-item local-dist\*.whl) --wheel-dir dist --add-path d:\lincs-deps\lib | ||
- name: Check the wheel | ||
run: twine check (get-item dist\*.whl) | ||
# - name: Build the wheel | ||
# run: python -m build --wheel --outdir local-dist (get-item lincs-*) | ||
# env: | ||
# LINCS_DEV_FORCE_NVCC: "true" | ||
# LINCS_DEV_DEPENDENCIES: d:\lincs-deps | ||
# LINCS_DEV_VC_VERSION: 142 | ||
# - name: Make the wheel machine-independent | ||
# run: delvewheel repair --strip (get-item local-dist\*.whl) --wheel-dir dist --add-path d:\lincs-deps\lib | ||
# - name: Check the wheel | ||
# run: twine check (get-item dist\*.whl) | ||
|
||
- name: Upload the wheel to GitHub Actions artifacts | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: wheel-dist-${{ matrix.python_version }}-windows | ||
path: dist | ||
# - name: Upload the wheel to GitHub Actions artifacts | ||
# uses: actions/upload-artifact@v4 | ||
# with: | ||
# name: wheel-dist-${{ matrix.python_version }}-windows | ||
# path: dist | ||
|
||
build-for-macos: | ||
runs-on: macos-11 | ||
needs: | ||
- build-for-windows | ||
strategy: | ||
matrix: | ||
python_version: ['3.8', '3.12'] | ||
env: | ||
MACOSX_DEPLOYMENT_TARGET: 11.0 | ||
steps: | ||
- name: Install Python | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: ${{ matrix.python_version }} | ||
- name: Install Python packages | ||
run: pip3 install build delocate pybind11 twine | ||
- name: Install OpenMP | ||
run: | | ||
cd /Users/runner/work | ||
mkdir openmp | ||
cd openmp | ||
wget https://mac.r-project.org/openmp/openmp-10.0.0-darwin17-Release.tar.gz | ||
tar xf *.tar.gz | ||
sudo cp usr/local/lib/* /usr/local/lib | ||
sudo cp usr/local/include/* /usr/local/include | ||
- name: Install Boost | ||
run: | | ||
cd /Users/runner/work | ||
wget https://boostorg.jfrog.io/artifactory/main/release/1.82.0/source/boost_1_82_0.tar.gz | ||
tar xf boost_*.tar.gz | ||
rm boost_*.tar.gz | ||
cd boost_* | ||
echo "using python : ${{ matrix.python_version }} ;" >tools/build/src/user-config.jam | ||
./bootstrap.sh | ||
./b2 --with-python python=${{ matrix.python_version }} link=shared variant=release stage | ||
sudo cp -r boost /usr/local/include | ||
sudo cp -r stage/lib/* /usr/local/lib | ||
- name: Install OR-Tools | ||
run: | | ||
cd /Users/runner/work | ||
wget https://github.com/google/or-tools/releases/download/v8.2/or-tools_MacOsX-11.2.1_v8.2.8710.tar.gz | ||
tar xf or-tools_*.tar.gz | ||
rm or-tools_*.tar.gz | ||
cd or-tools_* | ||
sudo cp -r include/* /usr/local/include | ||
sudo cp -r lib/* /usr/local/lib | ||
# build-for-macos: | ||
# runs-on: macos-11 | ||
# needs: | ||
# - build-for-windows | ||
# strategy: | ||
# matrix: | ||
# python_version: ['3.8', '3.12'] | ||
# env: | ||
# MACOSX_DEPLOYMENT_TARGET: 11.0 | ||
# steps: | ||
# - name: Install Python | ||
# uses: actions/setup-python@v5 | ||
# with: | ||
# python-version: ${{ matrix.python_version }} | ||
# - name: Install Python packages | ||
# run: pip3 install build delocate pybind11 twine | ||
# - name: Install OpenMP | ||
# run: | | ||
# cd /Users/runner/work | ||
# mkdir openmp | ||
# cd openmp | ||
# wget https://mac.r-project.org/openmp/openmp-10.0.0-darwin17-Release.tar.gz | ||
# tar xf *.tar.gz | ||
# sudo cp usr/local/lib/* /usr/local/lib | ||
# sudo cp usr/local/include/* /usr/local/include | ||
# - name: Install Boost | ||
# run: | | ||
# cd /Users/runner/work | ||
# wget https://boostorg.jfrog.io/artifactory/main/release/1.82.0/source/boost_1_82_0.tar.gz | ||
# tar xf boost_*.tar.gz | ||
# rm boost_*.tar.gz | ||
# cd boost_* | ||
# echo "using python : ${{ matrix.python_version }} ;" >tools/build/src/user-config.jam | ||
# ./bootstrap.sh | ||
# ./b2 --with-python python=${{ matrix.python_version }} link=shared variant=release stage | ||
# sudo cp -r boost /usr/local/include | ||
# sudo cp -r stage/lib/* /usr/local/lib | ||
# - name: Install OR-Tools | ||
# run: | | ||
# cd /Users/runner/work | ||
# wget https://github.com/google/or-tools/releases/download/v8.2/or-tools_MacOsX-11.2.1_v8.2.8710.tar.gz | ||
# tar xf or-tools_*.tar.gz | ||
# rm or-tools_*.tar.gz | ||
# cd or-tools_* | ||
# sudo cp -r include/* /usr/local/include | ||
# sudo cp -r lib/* /usr/local/lib | ||
|
||
- name: Dowload the source distribution from GitHub Actions artifacts | ||
uses: actions/download-artifact@v4 | ||
with: | ||
name: source-dist | ||
- name: Unzip the source distribution | ||
run: | | ||
tar xf *.tar.gz | ||
rm *.tar.gz | ||
# - name: Dowload the source distribution from GitHub Actions artifacts | ||
# uses: actions/download-artifact@v4 | ||
# with: | ||
# name: source-dist | ||
# - name: Unzip the source distribution | ||
# run: | | ||
# tar xf *.tar.gz | ||
# rm *.tar.gz | ||
|
||
- name: Build the wheel | ||
run: python3 -m build --wheel --outdir local-dist lincs-* | ||
- name: Make the wheel machine-independent | ||
run: delocate-wheel --wheel-dir dist local-dist/*.whl | ||
- name: Check the wheel | ||
run: twine check dist/*.whl | ||
# - name: Build the wheel | ||
# run: python3 -m build --wheel --outdir local-dist lincs-* | ||
# - name: Make the wheel machine-independent | ||
# run: delocate-wheel --wheel-dir dist local-dist/*.whl | ||
# - name: Check the wheel | ||
# run: twine check dist/*.whl | ||
|
||
- name: Upload the wheel to GitHub Actions artifacts | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: wheel-dist-${{ matrix.python_version }}-macos | ||
path: dist | ||
# - name: Upload the wheel to GitHub Actions artifacts | ||
# uses: actions/upload-artifact@v4 | ||
# with: | ||
# name: wheel-dist-${{ matrix.python_version }}-macos | ||
# path: dist |
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