-
Notifications
You must be signed in to change notification settings - Fork 240
38 lines (32 loc) · 1.37 KB
/
build_schema_page.yml
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
name: Config schema HTML build
permissions: read-all
on:
workflow_call:
jobs:
build-config-schema-html:
runs-on: ubuntu-20.04
steps:
- name: Checkout
uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6
- uses: actions/setup-python@0a5c61591373683505ea898e09a3ea4f39ef2b9c # v5.0.0
with:
python-version: 3.10.14
cache: pip
- name: Install and Build
run: |
pip install json-schema-for-humans
pip install .
python -c 'import jstyleson; from nncf.config import NNCFConfig; jstyleson.dump(NNCFConfig.schema(), open("./schema.json", "w"), indent=2)'
mkdir -p schema
# In the current approach the line below will replace the schema/index.html generated by a
# phony schema/index.rst. We only need the phony schema/index.rst at the sphinx-build stage so that
# the sphinx can generate valid links in the TOC for the JSON schema across all pages.
generate-schema-doc --deprecated-from-description schema.json schema/index.html
- name: Archive built schema
shell: bash
run: tar -czf artifact.tar schema
- name: Upload result as artifact
uses: actions/upload-artifact@6f51ac03b9356f520e9adb1b1b7802705f340c2b #v4.5.0
with:
name: schema_doc_artifact
path: artifact.tar