Repository navigation
154 lines (149 loc) · 5.25 KB
/
Copy pathdocs.yml
File metadata and controls
154 lines (149 loc) · 5.25 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
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
name: Documentation
on:
workflow_call:
inputs:
examples:
type: boolean
default: false
hosts:
type: boolean
default: false
native-wheel:
type: boolean
default: false
permissions:
contents: read
jobs:
examples:
name: Installed documentation examples
if: inputs.examples
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- uses: actions/setup-python@v7
with:
python-version: '3.15'
- uses: astral-sh/setup-uv@v10.3.3
- name: Reuse the selected native producer
if: inputs.native-wheel
uses: actions/download-artifact@v8
with:
name: native-linux-x86_64
path: dist/native
- name: Verify released, candidate and library-only examples
env:
NATIVE_WHEEL: ${{ inputs.native-wheel }}
run: |
args=()
if [[ "$NATIVE_WHEEL" == true ]]; then args+=(--native-wheel-dir dist/native); fi
python scripts/docs_check.py "${args[@]}"
- uses: actions/upload-artifact@v7
with:
name: documentation-examples
path: .dev/docs-examples.json
include-hidden-files: true
if-no-files-found: error
hosts:
name: Host recipe qualification
if: inputs.hosts
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- uses: actions/setup-python@v7
with:
python-version: '3.15'
- uses: actions/setup-node@v7
with:
node-version: '26'
- uses: astral-sh/setup-uv@v10.3.3
- uses: jdx/mise-action@v5
with:
install: false
- name: Install the qualified Python pair
run: |
uv venv .dev/docs-host-python
uv pip install --python .dev/docs-host-python/bin/python --only-binary=:all: --refresh morphir==0.1.1 morphir-python==0.1.2
- name: Run displayed recipe, offline bundle checks and MoonBit refusal probes
run: .dev/docs-host-python/bin/python scripts/docs_hosts.py qualify
- uses: actions/upload-artifact@v7
with:
name: documentation-hosts
path: .dev/docs-hosts/report.json
include-hidden-files: true
if-no-files-found: error
site:
name: Site build, checks and browser smoke
needs: [examples, hosts]
if: >-
always() &&
(!inputs.examples || needs.examples.result == 'success') &&
(!inputs.hosts || needs.hosts.result == 'success')
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- uses: actions/setup-python@v7
with:
python-version: '3.15'
- uses: actions/setup-node@v7
with:
node-version: '26'
- uses: astral-sh/setup-uv@v10.3.3
- name: Check site tooling and failure behavior
env:
MORPHIR_SITE_TEST: '1'
run: |
uv venv .dev/site-checker
uv pip install --python .dev/site-checker/bin/python pytest==9.0.2 ruff==0.14.13
.dev/site-checker/bin/ruff check scripts/docs_*.py scripts/site_*.py tests/unit/test_docs*.py tests/unit/test_site*.py
.dev/site-checker/bin/ruff format --check scripts/docs_*.py scripts/site_*.py tests/unit/test_docs*.py tests/unit/test_site*.py
.dev/site-checker/bin/python -m pytest tests/unit/test_site_tool.py tests/unit/test_site_release.py tests/unit/test_docs_hosts.py tests/unit/test_docs_examples.py tests/unit/test_ci_changes.py
- name: Install browser checks
run: |
npm ci --prefix site/browser
npm exec --prefix site/browser -- playwright install --with-deps chromium
- name: Build once at each base and check the actual browser experience
run: |
npm test --prefix site/browser
python scripts/site_tool.py check
python scripts/site_tool.py check --base / --out .dev/site-root
- name: Download example evidence
if: inputs.examples
uses: actions/download-artifact@v8
with:
name: documentation-examples
path: .dev/site-evidence
- name: Download host evidence
if: inputs.hosts
uses: actions/download-artifact@v8
with:
name: documentation-hosts
path: .dev/site-evidence
- name: Bind checked bytes and required evidence
env:
EXAMPLES: ${{ inputs.examples }}
HOSTS: ${{ inputs.hosts }}
run: |
args=()
if [[ "$EXAMPLES" == true ]]; then args+=(--examples .dev/site-evidence/docs-examples.json); fi
if [[ "$HOSTS" == true ]]; then
args+=(--hosts .dev/site-evidence/report.json)
else
args+=(--hosts site/evidence/hosts.json)
fi
python scripts/site_release.py seal "${args[@]}"
python scripts/site_tool.py check
- name: Retain the exact verified output
uses: actions/upload-artifact@v7
with:
name: documentation-site
path: _site/
if-no-files-found: error
retention-days: 30
- name: Retain browser evidence
if: always()
uses: actions/upload-artifact@v7
with:
name: documentation-browser
path: .dev/site-browser/
include-hidden-files: true
retention-days: 30