Skip to content

CI

CI #103

Workflow file for this run

name: CI
on:
push:
branches: [ main ]
tags:
- '*'
pull_request:
branches: [ main ]
schedule:
# Weekly build to make sure dependencies are OK
- cron: '30 14 * * 3'
jobs:
Source:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
submodules: true
- name: Install sdist dependencies
run: pip3 install setuptools
- name: Generate source distribution tarball
run: python3 setup.py sdist
- name: Build source distribution
run: |
sudo apt-get install -y libboost-system-dev libboost-thread-dev libeigen3-dev ninja-build
pip3 install wheel
pip3 wheel dist/*.tar.gz
- name: Upload Build Artifact
uses: actions/upload-artifact@v3
with:
name: source-build
path: "dist/*.tar.gz"
Linux:
runs-on: ubuntu-22.04
needs: Source
strategy:
matrix:
python: ['3.8', '3.9', '3.10', '3.11']
steps:
- uses: actions/checkout@v3
with:
submodules: true
- name: Pull builder image
run: docker pull quay.io/pypa/manylinux2014_x86_64
- name: Python version
run: python --version
- name: Build wheels
run: tools/build/build-wheels.sh ${{ matrix.python }}
- name: Upload Build Artifact
uses: actions/upload-artifact@v3
with:
name: linux-build
path: "dist/*.whl"
MacOS:
runs-on: macos-12
needs: Source
strategy:
matrix:
python: ['3.8', '3.9', '3.10', '3.11']
steps:
- uses: actions/checkout@v3
with:
submodules: true
- name: Set up Python ${{ matrix.python }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python }}
- name: Install dependencies
run: |
brew install eigen boost
pip install cmake ninja wheel
- name: Build
run: python setup.py bdist_wheel
- name: Upload Build Artifact
uses: actions/upload-artifact@v3
with:
name: macos-build
path: "dist/*.whl"
Windows:
runs-on: windows-2022
needs: Source
strategy:
matrix:
python: ['3.8', '3.9', '3.10', '3.11']
steps:
- uses: actions/checkout@v3
with:
submodules: true
- name: Set up Python ${{ matrix.python }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python }}
- name: Install dependencies
run: |
pip install wheel
vcpkg install eigen3:x64-windows
- name: Install boost
uses: MarkusJx/install-boost@v1.0.1
id: install-boost
with:
boost_version: 1.73.0
toolset: msvc14.2
- name: Build
run: python setup.py bdist_wheel
env:
BOOST_ROOT: ${{ steps.install-boost.outputs.BOOST_ROOT }}
CMAKE_TOOLCHAIN_FILE: "C:/vcpkg/scripts/buildsystems/vcpkg.cmake"
- name: Upload Build Artifact
uses: actions/upload-artifact@v3
with:
name: win-build
path: "dist/*.whl"
Publish:
runs-on: ubuntu-22.04
environment:
name: pypi
url: https://pypi.org/p/motioncapture
permissions:
id-token: write # IMPORTANT: this permission is mandatory for trusted publishing
needs: [Source, Linux, MacOS, Windows]
# Only run publish if we have tagged the version
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
steps:
# download all the artifacts
- uses: actions/download-artifact@v3
- name: Move all files into the dist folder
run: |
mkdir dist
mv source-build/* dist
mv linux-build/* dist
mv macos-build/* dist
mv win-build/* dist
ls -R dist
- uses: actions/setup-python@v4
with:
python-version: '3.8'
- name: Check match between the build version and the current git tag
run: |
sudo apt-get install -y jq
pip3 install wheel-inspect
export TAG=$(echo ${{ github.ref }} | cut -d/ -f3)
python3 -m wheel_inspect dist/*.whl | jq .version | grep ^\\\"$TAG\\\"$
- name: Publish on Pypi
uses: pypa/gh-action-pypi-publish@release/v1