Weekly Checks #11
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
name: Weekly Checks | |
on: | |
schedule: | |
- cron: "8 4 * * 1" | |
workflow_dispatch: | |
jobs: | |
check-documentation-hyperlinks: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Cache conda environment | |
id: conda-env-cache | |
uses: actions/cache@v4 | |
with: | |
key: conda|${{runner.os}}-${{runner.arch}}|${{hashFiles('requirements/locks/py312-lock-linux-64.txt')}} | |
path: | | |
~/conda-env | |
~/.local/share/cartopy | |
- name: Create conda environment | |
if: steps.conda-env-cache.outputs.cache-hit != 'true' | |
run: | | |
# Check cache hasn't pulled a partial key match. | |
test ! -e "${HOME}/conda-env" | |
conda create --prefix="${HOME}/conda-env" --file=requirements/locks/py312-lock-linux-64.txt | |
- name: Add conda environment to PATH | |
run: echo "${HOME}/conda-env/bin" >> $GITHUB_PATH | |
- name: Build documentation | |
run: | | |
# Install module so it can be imported during docs generation. | |
echo '::group::Installing local package' | |
python3 -m pip install . | |
echo '::endgroup::' | |
# Generate the documentation | |
echo '::group::Building the documentation' | |
sphinx-build -b html --color "docs/source" "docs/build/html" | |
echo '::endgroup::' | |
echo '::group::Checking for broken hyperlinks' | |
sphinx-build -b linkcheck --color -W --keep-going "docs/source" "docs/build/linkcheck" | |
echo '::endgroup::' | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: html-docs | |
path: docs/build/html/ | |
retention-days: 1 | |
if-no-files-found: error |