Skip to content

Commit

Permalink
Update github actions (#16).
Browse files Browse the repository at this point in the history
  • Loading branch information
jkanche authored Nov 10, 2023
1 parent 22629c5 commit b387917
Showing 1 changed file with 29 additions and 11 deletions.
40 changes: 29 additions & 11 deletions .github/workflows/pypi-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ name: Test the library
on:
push:
branches:
- main
- master
tags:
- "*"
pull_request:
Expand All @@ -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]
Expand All @@ -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
Expand Down

0 comments on commit b387917

Please sign in to comment.