-
Notifications
You must be signed in to change notification settings - Fork 240
34 lines (29 loc) · 1.27 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
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: Upload result as artifact
uses: alehechka/upload-tartifact@a055d3a102b9ed9cfff1263bc713295047d0197e # v2
with:
name: schema_doc_artifact
path: schema