Repository navigation
110 lines (96 loc) · 3.68 KB
/
Copy pathdocs-site.yml
File metadata and controls
110 lines (96 loc) · 3.68 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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
# Documentation site (ADR-0009). Linux-only, Node-only, and deliberately
# INDEPENDENT of the C++/CMake matrix in ci.yml: no CMake target invokes npm and
# no job here needs a C++ toolchain, so a developer build never requires Node.
name: docs site
on:
push:
branches: [main]
paths:
- 'docs/user-guide/**'
- 'docs-site/**'
- 'editor/src/theme/theme.cpp'
- 'editor/src/help/help_registry.cpp'
- '.github/workflows/docs-site.yml'
pull_request:
paths:
- 'docs/user-guide/**'
- 'docs-site/**'
- 'editor/src/theme/theme.cpp'
- 'editor/src/help/help_registry.cpp'
- '.github/workflows/docs-site.yml'
permissions:
contents: read
jobs:
build:
name: build docs site
runs-on: ubuntu-latest
defaults:
run:
working-directory: docs-site
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version-file: docs-site/.nvmrc
cache: npm
cache-dependency-path: docs-site/package-lock.json
# sharp is kept out by package.json's `overrides` (see stubs/sharp):
# its libvips binaries are LGPL-3.0-or-later and Qt is this project's only
# sanctioned LGPL dependency. `--omit=optional` was NOT usable here — it
# would also drop rollup's required native binary.
- name: Install
run: npm ci
- name: Licence gate
run: npm run licenses
- name: Script tests
run: npm test
# Built under a version segment rather than at the root, because that is
# how it is actually published and because a root build cannot exercise
# the base at all: Astro prefixes the links IT generates, so a missing
# prefix on the links written in the guide's Markdown is invisible until
# something is served from `/dev/`. build:web runs theme -> adapt -> F1
# coverage -> astro build -> the base check, in that order.
- name: Build (under a version segment, as published)
run: npm run build:web -- --base=/dev/
# Every internal link and image in the built output, checked against the
# base it was built with. The adapter's own check runs on SOURCE, so it
# cannot see a reference that only breaks once the pages are emitted.
- name: Internal links
run: npm run check:links
- uses: actions/upload-artifact@v4
with:
name: docs-site
path: docs-site/dist
retention-days: 7
# The offline reader that ships inside a release (ADR-0009 / docs-s2). Built
# separately from the web site because the two differ in output format and in
# whether search exists, so one build cannot prove the other works.
local:
name: build local reader
runs-on: ubuntu-latest
defaults:
run:
working-directory: docs-site
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version-file: docs-site/.nvmrc
cache: npm
cache-dependency-path: docs-site/package-lock.json
- name: Install
run: npm ci
# build:local ends in check-local-build.mjs, which fails on any surviving
# root-absolute href/src — the one thing that makes a build openable from
# a disc rather than only from a server.
- name: Build the local reader
run: npm run build:local
# The offline reader's links are relative rather than base-prefixed, so
# this is a genuinely different resolution path from the web build's.
- name: Internal links
run: npm run check:links
- uses: actions/upload-artifact@v4
with:
name: docs-manual-local
path: docs-site/dist
retention-days: 7