|
|
|
@ -6,9 +6,48 @@ name: Python Package
|
|
|
|
|
on: [ push, pull_request ]
|
|
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
|
test:
|
|
|
|
|
name: Run Unit Tests
|
|
|
|
|
runs-on: ${{ matrix.os }}
|
|
|
|
|
strategy:
|
|
|
|
|
matrix:
|
|
|
|
|
os: [ macos-12, windows-latest, ubuntu-latest ]
|
|
|
|
|
steps:
|
|
|
|
|
- name: Setup cmake
|
|
|
|
|
uses: jwlawson/actions-setup-cmake@v1.12
|
|
|
|
|
with:
|
|
|
|
|
cmake-version: 'latest'
|
|
|
|
|
github-api-token: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
|
|
|
|
|
|
- name: Set up Python
|
|
|
|
|
uses: actions/setup-python@v3.1.2
|
|
|
|
|
with:
|
|
|
|
|
python-version: '3.x'
|
|
|
|
|
|
|
|
|
|
- name: Install dependencies
|
|
|
|
|
run: |
|
|
|
|
|
python -m pip install --upgrade pip
|
|
|
|
|
python -m pip install flake8 pybind11
|
|
|
|
|
|
|
|
|
|
- name: Lint with flake8
|
|
|
|
|
run: |
|
|
|
|
|
# stop the build if there are Python syntax errors or undefined names
|
|
|
|
|
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
|
|
|
|
|
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
|
|
|
|
|
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
|
|
|
|
|
|
|
|
|
|
- name: Build C side with cmake
|
|
|
|
|
run: |
|
|
|
|
|
cmake .
|
|
|
|
|
cmake --build .
|
|
|
|
|
|
|
|
|
|
- name: Run C tests
|
|
|
|
|
run: ./Test
|
|
|
|
|
|
|
|
|
|
build-sdist:
|
|
|
|
|
name: Build SDist
|
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
|
needs: test
|
|
|
|
|
|
|
|
|
|
steps:
|
|
|
|
|
- uses: actions/checkout@v3
|
|
|
|
@ -22,16 +61,8 @@ jobs:
|
|
|
|
|
- name: Install dependencies
|
|
|
|
|
run: |
|
|
|
|
|
python -m pip install --upgrade pip
|
|
|
|
|
python -m pip install flake8
|
|
|
|
|
python -m pip install setuptools twine build
|
|
|
|
|
|
|
|
|
|
- name: Lint with flake8
|
|
|
|
|
run: |
|
|
|
|
|
# stop the build if there are Python syntax errors or undefined names
|
|
|
|
|
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
|
|
|
|
|
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
|
|
|
|
|
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
|
|
|
|
|
|
|
|
|
|
- name: Build SDist
|
|
|
|
|
run: python -m build --sdist
|
|
|
|
|
|
|
|
|
@ -46,6 +77,7 @@ jobs:
|
|
|
|
|
build-wheels:
|
|
|
|
|
name: Build Wheels on ${{ matrix.os }} ${{ matrix.arch[0] }}
|
|
|
|
|
runs-on: ${{ matrix.os }}
|
|
|
|
|
needs: test
|
|
|
|
|
strategy:
|
|
|
|
|
matrix:
|
|
|
|
|
os: [ macos-12, windows-latest, ubuntu-latest ]
|
|
|
|
|