Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* manylinux-wheel * Set build tests OFF by default * Added dependency to map_metrics_cpp target * [quickfix] Allowed git to run scripts from /scripts * Added chmod line in workflow * Specified cpp standard in script * quickfix syntax error * Removed parallel jobs * Explicitly set std=c++17 flag * Updated gcc in script * Try to pass init value into reduce * Replaced reduce with std::accumulate * configured setup.py * fixed name in setup.cfg * Fixes in setup.py * Try to specify package_data lib * __init__.py workaround * set build shared cilantro off * MORE workaround setup.py * Filled init.py and fixed path to data in python tests * quickfix initpy * quickfix for quickfix * Fixed tests * I will squash. Every. Commit. In this branch. * v0.0.3 linux * Added windows and osx into wheels.yml * Added build wheels scripts for windows and osx * Modified setup.py * macos fix build whee; * Specified std=c++17 for macos * quickfix wheels.yml * fixed typo in cmake_cxx_standard_required * try to specify cxx flag in script * changed macosx deployment target 10.14 * Set root_is_pure=False for OSX * Added auditwheel into macOS script, try to repair * once again try mrob setup.py * fixed setup error * Fixed macos target version in test_wheel_macos * Returned linux build tests * Returned windows build tests * Fixed readme Co-authored-by: Arthur_Ch <56088401+ArthurChains@users.noreply.github.com>
- Loading branch information
Showing
42 changed files
with
754 additions
and
134 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 |
---|---|---|
@@ -0,0 +1,284 @@ | ||
# # # # # # # # # | ||
# Source: https://github.com/miloserdova-l/mrob/blob/feature/windows-wheel/.github/workflows/wheels.yml | ||
# # # # # # # # # | ||
name: Build wheels | ||
|
||
on: [push, pull_request, workflow_dispatch] | ||
|
||
jobs: | ||
build: | ||
name: Build map_metrics project | ||
runs-on: ubuntu-latest | ||
env: | ||
PYTHONPATH: ./lib | ||
strategy: | ||
fail-fast: false | ||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- name: Install required packages from distro | ||
run: | | ||
sudo apt-get update | ||
sudo apt-get install -y --no-install-recommends git build-essential g++ cmake python3-distutils python3-dev python3-numpy python3-pip | ||
python3 -m pip install pytest | ||
- name: Configure and build native map_metrics library with Python bindings | ||
run: | | ||
mkdir -p build | ||
cmake -S $PWD -B $PWD/build \ | ||
-DCMAKE_RUNTIME_OUTPUT_DIRECTORY=$PWD/bin \ | ||
-DCMAKE_LIBRARY_OUTPUT_DIRECTORY=$PWD/lib \ | ||
-DCMAKE_BUILD_TYPE=RELEASE \ | ||
&& cmake --build build -j $(nproc) | ||
build_wheel_linux: | ||
name: Build wheel on ${{ matrix.os }} | ||
runs-on: ${{ matrix.os }} | ||
container: quay.io/pypa/manylinux2010_x86_64 | ||
needs: build | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
os: [ubuntu-latest] | ||
steps: | ||
- name: Install additional utils | ||
run: yum install -y git openssh-clients | ||
|
||
- uses: actions/checkout@v1 | ||
|
||
- name: Install fresh CMake into ManyLinux container | ||
run: | | ||
env pybin=$(LANG=C ls -d1r /opt/python/cp3*/bin | head -n 1) bash -c '$pybin/python -m pip install cmake && mkdir -p /usr/local/bin && ln -svf $pybin/cmake /usr/local/bin/cmake' | ||
cmake --version | ||
- name: Build Python wheel | ||
run: | | ||
chmod -R +x scripts/* \ | ||
&& scripts/build-wheels-linux.sh | ||
- uses: actions/upload-artifact@v1 | ||
with: | ||
name: artifact | ||
path: ./wheelhouse | ||
|
||
build_wheel_macOS: | ||
name: Build wheel on ${{ matrix.os }} | ||
runs-on: ${{ matrix.os }} | ||
needs: build | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
os: [ macos-10.15 ] | ||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- name: Git fetch | ||
run: git fetch --prune --unshallow --recurse-submodules=no | ||
|
||
- name: Install packages | ||
run: | | ||
brew install coreutils \ | ||
&& brew install gcc | ||
- name: Build wheel | ||
run: ./scripts/build-wheels-macOS.sh | ||
|
||
- uses: actions/upload-artifact@v2 | ||
with: | ||
path: ./dist | ||
|
||
build_wheel_windows: | ||
name: Build wheel on ${{ matrix.os }} ${{ matrix.arch }} | ||
needs: build | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
os: [ windows-2019 ] | ||
arch: [ x64, x86 ] | ||
steps: | ||
- uses: actions/checkout@v2 | ||
with: | ||
submodules: recursive | ||
- name: Git fetch | ||
run: git fetch --prune --unshallow --recurse-submodules=no | ||
|
||
- name: Setup Python 3.6 | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: 3.6 | ||
architecture: ${{ matrix.arch }} | ||
- name: Setup Python 3.7 | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: 3.7 | ||
architecture: ${{ matrix.arch }} | ||
- name: Setup Python 3.8 | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: 3.8 | ||
architecture: ${{ matrix.arch }} | ||
- name: Setup Python 3.9 | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: 3.9 | ||
architecture: ${{ matrix.arch }} | ||
- name: Setup Python 3.10 | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: '3.10' | ||
architecture: ${{ matrix.arch }} | ||
|
||
- name: Build wheel | ||
run: .\scripts\build-wheels-windows.cmd ${{ matrix.arch }} | ||
- uses: actions/upload-artifact@v2 | ||
with: | ||
path: .\dist | ||
|
||
test_wheel_linux: | ||
name: Test Python ${{ matrix.python }} wheel on Linux | ||
runs-on: ubuntu-latest | ||
needs: build_wheel_linux | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
python: ['3.6', '3.7', '3.8', '3.9', '3.10'] | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
|
||
- name: Setup Python ${{ matrix.python }} | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: ${{ matrix.python }} | ||
|
||
- name: Download artifacts | ||
uses: actions/download-artifact@v2 | ||
|
||
- name: Install map_metrics & numpy | ||
run: | | ||
python -m pip install ./artifact/map_metrics-*-manylinux*.whl numpy pytest | ||
- name: "Python unit tests" | ||
run: | | ||
python -m pytest python | ||
test_wheel_macos: | ||
name: Test Python ${{ matrix.python }} wheel on macOS | ||
runs-on: macos-latest | ||
needs: build_wheel_macos | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
python: ['3.6', '3.7', '3.8', '3.9', '3.10'] | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
|
||
- name: Setup Python ${{ matrix.python }} | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: ${{ matrix.python }} | ||
|
||
- name: Download artifacts | ||
uses: actions/download-artifact@v2 | ||
|
||
- name: Install map_metrics & numpy | ||
run: | | ||
python -m pip install ./artifact/map_metrics-*-macosx_10_14_x86_64.whl numpy pytest | ||
- name: "Python unit tests" | ||
run: | | ||
python -m pytest python | ||
test_wheel_windows64: | ||
name: Test Python ${{ matrix.python }} wheel on Windows 64bit | ||
runs-on: windows-latest | ||
needs: build_wheel_windows | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
python: ['3.6', '3.7', '3.8', '3.9', '3.10'] | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
|
||
- name: Setup Python ${{ matrix.python }} | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: ${{ matrix.python }} | ||
|
||
- name: Download artifacts | ||
uses: actions/download-artifact@v2 | ||
|
||
- name: Install map_metrics & numpy | ||
run: | | ||
python -m pip install .\artifact\$(dir artifact -Name | findstr map_metrics-.*-win_amd64.whl) numpy pytest | ||
- name: "Python unit tests" | ||
run: | | ||
python -m pytest python | ||
test_wheel_windows32: | ||
name: Test Python ${{ matrix.python }} wheel on Windows 32bit | ||
runs-on: windows-latest | ||
needs: build_wheel_windows | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
python: ['3.6', '3.7', '3.8', '3.9', '3.10'] | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
|
||
- name: Setup Python ${{ matrix.python }} | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: ${{ matrix.python }} | ||
architecture: x86 | ||
|
||
- name: Download artifacts | ||
uses: actions/download-artifact@v2 | ||
|
||
- name: Install map_metrics & numpy | ||
run: | | ||
python -m pip install .\artifact\$(dir artifact -Name | findstr map_metrics-.*-win32.whl) numpy | ||
- name: "Python unit tests" | ||
run: | | ||
$files = Get-ChildItem -Path python_examples -Include *.py | ||
foreach ($f in $files){ | ||
python $f.FullName || EXIT /B !ERRORLEVEL! | ||
} | ||
publish_pypi: | ||
name: Publish wheels to PyPI | ||
needs: | ||
- test_wheel_linux | ||
- test_wheel_macos | ||
- test_wheel_windows64 | ||
- test_wheel_windows32 | ||
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags') | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Download artifacts | ||
uses: actions/download-artifact@v2 | ||
|
||
- name: Publish to PyPI | ||
uses: pypa/gh-action-pypi-publish@release/v1 | ||
with: | ||
user: __token__ | ||
password: ${{ secrets.PYPI_API_TOKEN }} | ||
packages_dir: artifact/ | ||
|
||
publish-github-release: | ||
name: Publish wheels to GitHub Releases | ||
needs: | ||
- test_wheel_linux | ||
- test_wheel_macos | ||
- test_wheel_windows64 | ||
- test_wheel_windows32 | ||
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags') | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Download artifacts | ||
uses: actions/download-artifact@v2 | ||
|
||
- uses: softprops/action-gh-release@v1 | ||
with: | ||
files: artifact/*.whl | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
This file was deleted.
Oops, something went wrong.
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 was deleted.
Oops, something went wrong.
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
Oops, something went wrong.