Skip to content

Commit

Permalink
Split the test and doc building into separate Actions.
Browse files Browse the repository at this point in the history
This allows us to propagate docfixes more quickly. We also make sure
that the shared library is correctly built here.
  • Loading branch information
LTLA committed Sep 20, 2023
1 parent 7bbf662 commit a4d3ee0
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 22 deletions.
47 changes: 47 additions & 0 deletions .github/workflows/build-docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: Build documentation

on:
push:
branches:
- master

jobs:
test:
name: Build docs
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
with:
submodules: true

- name: Set up Python 3.9
uses: actions/setup-python@v2
with:
python-version: 3.9
cache: 'pip'

- name: Set up ccache
uses: hendrikmuhs/[email protected]

- name: Install Python dependencies
run: |
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:]))')
pip install ${DEPENDENCIES}
pip install sphinx myst-parser[linkify] furo
# Note that doc building requires the inplace shared library.
- name: Build docs
run: |
CC="ccache gcc" python setup.py build_ext --inplace
sphinx-build --color -b html -d docs/doctrees docs docs/_build/html
touch ./docs/_build/html/.nojekyll
- name: GH Pages Deployment
if: github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/tags/')
uses: JamesIves/[email protected]
with:
branch: gh-pages # The branch the action should deploy to.
folder: ./docs/_build/html
clean: true # Automatically remove deleted files from the deploy branch
25 changes: 3 additions & 22 deletions .github/workflows/pypi-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,17 +21,13 @@ jobs:
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
- name: Install python dependencies
run: |
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:]))')
Expand All @@ -44,13 +40,7 @@ jobs:
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.
# Otherwise, in a PR, we don't need the full clean test.
- name: Set up ccache
if: github.ref != 'refs/heads/master' && !startsWith(github.ref, 'refs/tags')
uses: hendrikmuhs/[email protected]
Expand All @@ -61,14 +51,6 @@ jobs:
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]
with:
branch: gh-pages # The branch the action should deploy to.
folder: ./docs/_build/html
clean: true # Automatically remove deleted files from the deploy branch

build_wheels:
name: Build wheels on ${{ matrix.os }}
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')
Expand All @@ -88,8 +70,7 @@ jobs:
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* # remove this later, but for some reason fails to generate pypy wheels

CIBW_SKIP: pp*
- uses: actions/upload-artifact@v3
with:
path: ./wheelhouse/*.whl
Expand Down

0 comments on commit a4d3ee0

Please sign in to comment.