-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Split the test and doc building into separate Actions.
This allows us to propagate docfixes more quickly. We also make sure that the shared library is correctly built here.
- Loading branch information
Showing
2 changed files
with
50 additions
and
22 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 |
---|---|---|
@@ -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 |
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 |
---|---|---|
|
@@ -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:]))') | ||
|
@@ -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] | ||
|
@@ -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/') | ||
|
@@ -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 | ||
|