Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions .github/workflows/documentation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,16 @@ on:
default: false
required: false
type: boolean
upload-artifact:
description: "Upload the built documentation (`docs/build`) as a workflow artifact named `docs-artifact` when the build succeeds, so it can be downloaded and inspected, e.g. for pull requests from forks, which cannot deploy a preview"
default: false
required: false
type: boolean
artifact-retention-days:
description: "Number of days to keep the documentation artifact uploaded by `upload-artifact` (0 uses the repository default)"
default: 3
required: false
type: number

jobs:
tests:
Expand Down Expand Up @@ -110,6 +120,20 @@ jobs:
DOCUMENTER_KEY: ${{ env.CAN_DEPLOY_DOCS == 'true' && inputs.use-documenter-key && (inputs.documenter-key || secrets.DOCUMENTER_KEY) || '' }}
run: ${{ inputs.debug-documenter && 'JULIA_DEBUG="Documenter"' || '' }} julia --color=yes --project=docs/ ${{ inputs.coverage && '--code-coverage=user' || '' }} docs/make.jl

- name: "Upload Documentation as Artifact"
# Like every step without a status function in its `if:`, this runs only when the
# steps before it succeeded, so a failed build uploads nothing. Pull requests from
# forks cannot deploy a preview (see CAN_DEPLOY_DOCS), so this artifact is the only
# way to inspect their rendered documentation.
uses: actions/upload-artifact@v7
if: "${{ inputs.upload-artifact }}"
with:
name: "docs-artifact"
path: "docs/build"
retention-days: "${{ inputs.artifact-retention-days }}"
compression-level: 9
overwrite: true

- name: "Filter coverage directories to those that exist"
# julia-processcoverage hard-errors on directories that don't exist
# (the "src,ext" default includes ext even for packages without
Expand Down
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -298,6 +298,8 @@ documentation (and runs doctests, with coverage).
| `coverage` | boolean | `true` | Collect doctest coverage. |
| `coverage-directories` | string | `"src,ext"` | Coverage dirs. |
| `continue-on-error` | boolean | — | Don't fail the run if the job fails. |
| `upload-artifact` | boolean | `false` | Upload `docs/build` as the workflow artifact `docs-artifact` when the build succeeds. |
| `artifact-retention-days` | number | `3` | Days to keep that artifact (`0` = repository default). |

```yaml
jobs:
Expand All @@ -306,6 +308,11 @@ jobs:
secrets: "inherit"
```

Pull requests from forks can't deploy a documentation preview, so the job
only reports whether the docs build. To let reviewers download and inspect
the rendered docs, set `upload-artifact: true`; the site then appears as
`docs-artifact` under the run's **Artifacts**.

### `runic.yml`

Checks formatting with [Runic](https://github.com/fredrikekre/Runic.jl) — the
Expand Down
Loading