forked from openvinotoolkit/nncf
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add GH workflows for doc builds and API checks
- Loading branch information
Showing
10 changed files
with
116 additions
and
23 deletions.
There are no files selected for viewing
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
name: API changes check | ||
on: | ||
pull_request_target: | ||
branches: | ||
- develop | ||
|
||
env: | ||
API_DOC_HTML_ROOT_RELATIVE_PATH: autoapi | ||
|
||
concurrency: | ||
group: ci-${{ github.head_ref }}-${{ github.workflow }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
call-build-api-doc: | ||
uses: ./.github/workflows/build_html_doc.yml | ||
compare-api-doc-with-develop: | ||
needs: call-build-api-doc | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Download built HTML doc as artifact from previous step | ||
uses: alehechka/download-tartifact@v2 | ||
with: | ||
name: html_doc_artifact | ||
- name: Checkout latest doc_pages branch tip | ||
uses: actions/checkout@v3 | ||
with: | ||
ref: doc_pages | ||
path: previous_doc_state | ||
- name: Get changed file names in API doc path | ||
id: diff | ||
run: | | ||
cd html_build/html/$API_DOC_HTML_ROOT_RELATIVE_PATH | ||
find . -name "*.html" -exec diff -qrBZ {} $GITHUB_WORKSPACE/previous_doc_state/$API_DOC_HTML_ROOT_RELATIVE_PATH/{} \; | ||
- uses: actions-ecosystem/action-add-labels@v1 | ||
if: ${{ steps.diff.outputs }} != "" | ||
with: | ||
labels: API |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
name: Build complete docs and publish to GH Pages | ||
on: | ||
push: | ||
branches: | ||
- develop | ||
|
||
env: | ||
GH_PAGES_BRANCH: doc_pages | ||
|
||
concurrency: | ||
group: ci-${{ github.head_ref }}-${{ github.workflow }} | ||
cancel-in-progress: true | ||
|
||
permissions: | ||
contents: write | ||
jobs: | ||
call-build-html-doc: | ||
uses: ./.github/workflows/build_html_doc.yml | ||
call-build-schema-page: | ||
uses: ./.github/workflows/build_schema_page.yml | ||
publish: | ||
needs: [call-build-html-doc, call-build-schema-page] | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout main repo # the github-pages-deploy-action seems to require this step | ||
uses: actions/checkout@v3 | ||
- name: Download HTML doc build artifact | ||
uses: alehechka/download-tartifact@v2 | ||
with: | ||
name: html_doc_artifact | ||
- name: Download schema doc build artifact | ||
uses: alehechka/download-tartifact@v2 | ||
with: | ||
name: schema_doc_artifact | ||
path: html_build/html | ||
- name: Publish built docs on Github Pages branch ${{ env.GH_PAGES_BRANCH }} | ||
uses: JamesIves/github-pages-deploy-action@v4 | ||
with: | ||
folder: html_build/html | ||
token: ${{ secrets.PUSH_TO_GH_PAGES_BRANCH }} | ||
branch: ${{ env.GH_PAGES_BRANCH }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
name: HTML documentation build | ||
on: | ||
workflow_call: | ||
jobs: | ||
build-html: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
- name: Install NNCF and doc requirements | ||
run: | | ||
pip install -e . | ||
pip install -r docs/api/requirements.txt | ||
- name: Build API docs | ||
run: | | ||
sphinx-build -M html docs/api/source html_build | ||
- name: Upload built HTMLs as job artifact | ||
uses: alehechka/upload-tartifact@v2 | ||
with: | ||
name: html_doc_artifact | ||
path: html_build/html |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,28 @@ | ||
name: Config schema HTML build | ||
on: | ||
push: | ||
pull_request_target: | ||
branches: | ||
- develop | ||
- test_for_doc_build_trigger | ||
paths: | ||
- nncf/config/** | ||
permissions: | ||
contents: write | ||
workflow_call: | ||
jobs: | ||
build-and-deploy: | ||
concurrency: ci-${{ github.ref }} # Recommended if you intend to make multiple deployments in quick succession. | ||
build-config-schema-html: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
|
||
- name: Install and Build # This example project is built using npm and outputs the result to the 'build' folder. Replace with the commands required to build your project, or remove this step entirely if your site is pre-built. | ||
- name: Install and Build | ||
run: | | ||
pip install json-schema-for-humans | ||
pip install -e . | ||
python -c 'import jstyleson; from nncf.config import NNCFConfig; jstyleson.dump(NNCFConfig.schema(), open("./schema.json", "w"), indent=2)' | ||
mkdir schema_html_build | ||
generate-schema-doc --deprecated-from-description schema.json schema_html_build/index.html | ||
- name: Deploy | ||
uses: JamesIves/github-pages-deploy-action@v4 | ||
mkdir schema | ||
generate-schema-doc --deprecated-from-description schema.json schema/index.html | ||
- name: Upload result as artifact | ||
uses: alehechka/upload-tartifact@v2 | ||
with: | ||
folder: schema_html_build # The folder the action should deploy. | ||
token: ${{ secrets.PUSH_TO_GH_PAGES_BRANCH }} | ||
branch: doc_pages | ||
name: schema_doc_artifact | ||
path: schema |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,10 @@ | ||
NNCF doc testing! | ||
NNCF documentation | ||
================================ | ||
|
||
.. toctree:: | ||
:caption: Contents: | ||
:maxdepth: 3 | ||
|
||
API Reference<autoapi/nncf/index> | ||
JSON configuration file schema<./schema.html#http://> | ||
JSON configuration file schema<./schema#http://> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters