Skip to content

Refactor code

Refactor code #58

Workflow file for this run

name: Build
on: [push, pull_request]
jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Check out repository code
uses: actions/checkout@v4
- name: Install testing framework
run: python -m pip install pytest
- name: Run pure python tests
run: pytest
- name: Install Cython
run: python -m pip install -r requirements-cython.txt
- name: Run pure python tests with Cython installed
run: pytest
- name: Build the extension
run: python setup_cython.py build_ext --inplace --force
- name: Run Cythonized library tests
run: pytest
- name: Run performance test
run: python tests/testconfig.py
make_sdist:
needs: test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Make Sdist
run: python setup.py sdist
- uses: actions/upload-artifact@v4
with:
name: artifact-source
path: dist/*.tar.gz
build_wheels:
name: Build wheels on ${{ matrix.os }}
needs: test
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macOS-latest]
steps:
- uses: actions/checkout@v4
# Used to host cibuildwheel
- uses: actions/setup-python@v5
with:
python-version: '3.10'
env:
PIP_DISABLE_PIP_VERSION_CHECK: 1
- name: Install cibuildwheel
run: python -m pip install cibuildwheel
- name: Build wheels
run: python -m cibuildwheel --output-dir wheelhouse
env:
CIBW_BEFORE_BUILD: pip install -r requirements-cython.txt
CIBW_SKIP: pp*
CIBW_TEST_REQUIRES: pytest
CIBW_TEST_COMMAND: pytest {project}
CIBW_TEST_SKIP: "cp38-macosx_arm64"
- uses: actions/upload-artifact@v4
with:
name: artifact-${{ matrix.os }}
path: ./wheelhouse/*.whl
merge_artifacts:
runs-on: ubuntu-latest
needs: [make_sdist, build_wheels]
steps:
- name: Merge Artifacts
uses: actions/upload-artifact/merge@v4
with:
name: armaclass
pattern: artifact-*
# upload_all:
# needs: [ build_wheels, make_sdist ]
# runs-on: ubuntu-latest
# if: github.event_name == 'release' && github.event.action == 'published'
# steps:
# - uses: actions/download-artifact@v3
# with:
# name: artifact
# path: dist
#
# - uses: pypa/[email protected]
# with:
# user: __token__
# password: ${{ secrets.pypi_password }}