-
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 add ccache for faster doc builds and PR tests where we don't need the full tox checks from a clean slate.
- Loading branch information
Showing
2 changed files
with
61 additions
and
19 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,37 +21,32 @@ 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 | ||
pip install pytest tox numpy mattress | ||
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: Test with tox | ||
if: github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/tags/') | ||
run: tox | ||
|
||
- name: Build docs | ||
if: github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/tags') | ||
run: | | ||
tox -e docs | ||
touch ./docs/_build/html/.nojekyll | ||
# 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] | ||
|
||
- 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 | ||
- 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 | ||
build_wheels: | ||
name: Build wheels on ${{ matrix.os }} | ||
|