-
Notifications
You must be signed in to change notification settings - Fork 3
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
29 additions
and
11 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 |
---|---|---|
|
@@ -6,7 +6,7 @@ name: Test the library | |
on: | ||
push: | ||
branches: | ||
- main | ||
- master | ||
tags: | ||
- "*" | ||
pull_request: | ||
|
@@ -20,30 +20,53 @@ jobs: | |
- uses: actions/checkout@v3 | ||
with: | ||
submodules: true | ||
|
||
- name: "Install dependencies" | ||
run: | | ||
sudo apt-get install zlib1g-dev | ||
- name: Set up Python 3.9 | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: 3.9 | ||
cache: 'pip' | ||
|
||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install flake8 pytest tox cython numpy | ||
python -m pip install --upgrade pip setuptools | ||
DEPENDENCIES=$(python -c 'from setuptools.config.setupcfg import read_configuration as c; a = c("setup.cfg"); print(" ".join(a["options"]["install_requires"][1:] + a["options"]["extras_require"]["testing"][1:]))') | ||
pip install ${DEPENDENCIES} | ||
- name: Download rds2cpp deps | ||
run: | | ||
cd extern/rds2cpp | ||
cmake . | ||
cd ../.. | ||
# We do proper tests if we're on the master branch, or if we're creating a new release. | ||
- name: Test with tox | ||
if: github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/tags/') | ||
run: | | ||
python setup.py build_ext --inplace | ||
pip install tox | ||
tox | ||
- name: Build docs | ||
if: github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/tags/') | ||
run: | | ||
tox -e docs | ||
touch ./docs/_build/html/.nojekyll | ||
# Otherwise we do some cached builds and tests for faster merging of PRs. | ||
- name: Set up ccache | ||
if: github.ref != 'refs/heads/master' && !startsWith(github.ref, 'refs/tags') | ||
uses: hendrikmuhs/[email protected] | ||
|
||
- name: Quickly build and test | ||
if: github.ref != 'refs/heads/master' && !startsWith(github.ref, 'refs/tags') | ||
run: | | ||
CC="ccache gcc" python setup.py install | ||
pytest | ||
- name: GH Pages Deployment | ||
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/') | ||
uses: JamesIves/[email protected] | ||
|
@@ -65,19 +88,14 @@ jobs: | |
with: | ||
submodules: true | ||
|
||
- name: Download dependencies | ||
run: | | ||
cd extern/rds2cpp | ||
cmake . | ||
cd ../.. | ||
- name: Build wheels | ||
uses: pypa/[email protected] | ||
env: | ||
CIBW_ARCHS_MACOS: x86_64 arm64 | ||
CIBW_ARCHS_LINUX: x86_64 # remove this later so we build for all linux archs | ||
CIBW_PROJECT_REQUIRES_PYTHON: ">=3.9" | ||
CIBW_SKIP: pp* | ||
CIBW_SKIP: pp* # remove this later, but for some reason fails to generate pypy wheels | ||
|
||
- uses: actions/upload-artifact@v3 | ||
with: | ||
path: ./wheelhouse/*.whl | ||
|