-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
43 additions
and
15 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 |
---|---|---|
|
@@ -3,28 +3,56 @@ name: Tests | |
on: [push, pull_request] | ||
|
||
jobs: | ||
build: | ||
name: Build wheel for on cp${{ matrix.python }}-${{ matrix.os }} | ||
runs-on: ${{ matrix.os }} | ||
build_sdist: | ||
name: Build source distribution | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-python@v5 | ||
with: | ||
python-version: "3.12" | ||
- name: Build | ||
run: | | ||
python -m pip install --upgrade pip | ||
python -m pip install build | ||
python -m build --sdist | ||
pip install -v dist/editdistpy-*.tar.gz | ||
- name: Install test dependencies | ||
run: | | ||
python -m pip install pytest numpy symspellpy | ||
pytest tests | ||
- uses: actions/upload-artifact@v4 | ||
with: | ||
name: artifact-sdist | ||
path: dist/*.tar.gz | ||
build_wheels_linux: | ||
name: Build wheels for ubuntu-latest/${{ matrix.arch }}/${{ matrix.python_tag }} | ||
needs: [build_sdist] | ||
runs-on: ubuntu-latest | ||
strategy: | ||
# Ensure that a wheel builder finishes even if another fails | ||
fail-fast: false | ||
matrix: | ||
python: ["3.8", "3.9", "3.10", "3.11", "3.12"] | ||
os: [ubuntu-latest, windows-latest, macos-latest] | ||
|
||
arch: [x86_64] | ||
python_tag: ["cp38-*", "cp39-*", "cp310-*", "cp311-*", "cp312-*"] | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Build wheels | ||
uses: pypa/[email protected] | ||
- uses: actions/download-artifact@v4 | ||
with: | ||
name: artifact-sdist | ||
path: dist | ||
- name: Copy wheel | ||
run: cp dist/editdistpy-*.tar.gz editdistpy.tar.gz | ||
- name: Build wheel | ||
uses: pypa/[email protected] | ||
env: | ||
CIBW_BUILD: cp${{ matrix.python }}-${{ matrix.platform }} | ||
CIBW_MANYLINUX_X86_64_IMAGE: manylinux2014 | ||
CIBW_ARCHS_LINUX: ${{ matrix.arch }} | ||
CIBW_BUILD: ${{ matrix.python_tag }} | ||
CIBW_BUILD_VERBOSITY: 3 | ||
CIBW_BEFORE_TEST: pip install -r {project}/requirements-dev.txt | ||
CIBW_BEFORE_TEST: pip install symspellpy --no-deps | ||
CIBW_TEST_REQUIRES: pytest numpy | ||
CIBW_TEST_COMMAND: pytest -sv {project}/tests | ||
|
||
with: | ||
package-dir: editdistpy.tar.gz | ||
output-dir: wheelhouse | ||
- uses: actions/upload-artifact@v4 | ||
with: | ||
path: ./wheelhouse/*.whl |