Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update gh action, change main to master #16

Merged
merged 4 commits into from
Nov 10, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading