Repository navigation
84 lines (75 loc) · 2.83 KB
/
Copy pathdocs.yml
File metadata and controls
84 lines (75 loc) · 2.83 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
name: docs
# Build the main Clawpack documentation (doc/doc) and fail on any NEW
# reStructuredText / docstring warning relative to the committed baseline
# (doc/tools/doc_warnings_baseline.txt). This only parses/renders the docs
# (the `dummy` builder writes no HTML) and does not deploy.
#
# The baseline is reproducible because both halves of the environment are
# pinned: the toolchain in doc/tools/requirements-docs.txt and the Clawpack
# source tree in doc/tools/clawpack-ref.txt. A maintainer regenerates it with
# the same two pins locally --
#
# cd doc && make claw-pin && CLAW=$(cd ../.claw-pin && pwd) make checkwarnings-update
#
# -- in a virtualenv with no clawpack installed, and CI reproduces the result.
# The workflow_dispatch path below remains as a fallback for regenerating it
# on a runner instead.
on:
pull_request:
branches: [dev, v5.14.x]
push:
branches: [dev, v5.14.x]
workflow_dispatch:
inputs:
update_baseline:
description: 'Regenerate the warning baseline and upload it as an artifact'
type: boolean
default: false
permissions:
contents: read
concurrency:
group: docs-${{ github.ref }}
cancel-in-progress: true
jobs:
# Unit tests for the scripts in doc/tools/. No doc toolchain and no source
# tree, so it finishes in seconds and gives a clear signal separate from the
# build itself.
tools-tests:
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@v5
with:
persist-credentials: false
- uses: actions/setup-python@v6
with:
python-version: '3.12'
- name: Run the tools tests
working-directory: doc
run: make tools-tests
checkwarnings:
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- uses: actions/checkout@v5
with:
persist-credentials: false
- uses: ./.github/actions/setup-doc-build
- name: Check for new documentation warnings
if: ${{ !(github.event_name == 'workflow_dispatch' && inputs.update_baseline) }}
working-directory: doc
run: make checkwarnings
# Manual fallback: regenerate the baseline on the runner and upload it so
# a maintainer can commit it. The pin check is redundant here -- the
# composite action already materialised exactly the pinned tree -- so it
# is skipped rather than re-run.
- name: Regenerate baseline
if: ${{ github.event_name == 'workflow_dispatch' && inputs.update_baseline }}
working-directory: doc
run: make checkwarnings-update ALLOW_UNPINNED=1
- name: Upload regenerated baseline
if: ${{ github.event_name == 'workflow_dispatch' && inputs.update_baseline }}
uses: actions/upload-artifact@v4
with:
name: doc_warnings_baseline
path: doc/tools/doc_warnings_baseline.txt