-
Notifications
You must be signed in to change notification settings - Fork 110
[DLStreamer] New CI workflow for building DL Streamer documentation #176
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
f16e06a
Add new workflow for building and checking DL Streamer documentation
dmichalo 682250c
Add comment about self-hosted runners to unblock linkcheck
dmichalo 4c78b73
Change format of build_html.sh script
dmichalo e39788f
Set final workflow trigger
dmichalo 83a08a5
Remove ARM64 label from comment
dmichalo e7fb907
Change tags to hashs and remove workflow_call
dmichalo 31781c2
Merge branch 'main' into dls_dmichalo_DocumentationCIWorkflow
dmichalo File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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,86 @@ | ||
| name: "[DLS] Documentation PR workflow" | ||
| run-name: "[DLS] Documentation PR workflow (by @${{ github.actor }} via ${{ github.event_name }})" | ||
| on: | ||
| push: | ||
| branches: | ||
| - 'main' | ||
| paths: | ||
| - 'libraries/dl-streamer/docs/**' | ||
| pull_request: | ||
| paths: | ||
| - 'libraries/dl-streamer/docs/**' | ||
| permissions: read-all | ||
|
|
||
| jobs: | ||
| build-docs: | ||
| name: Build DL Streamer documentation | ||
| runs-on: ubuntu-latest # Change to self-hosted when ready to unblock linkcheck: [self-hosted, linux] | ||
| steps: | ||
| - name: Check out edge-ai-libraries repository/libraries/dl-streamer | ||
| uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 #4.2.2 | ||
| with: | ||
| sparse-checkout: | | ||
| libraries/dl-streamer | ||
|
|
||
| - name: Run build script | ||
| run: | | ||
| ./libraries/dl-streamer/docs/build_html.sh "actions-gh-pages:latest" gh-pages | ||
|
|
||
| - name: Documentation build summary | ||
| if: always() | ||
| run: | | ||
| summary_content="" | ||
|
|
||
| # Check if index.html for documentation exists | ||
| index_file_path='./libraries/dl-streamer/docs/build-html/index.html' | ||
| if [ -f "$index_file_path" ]; then | ||
| result="Documentation built: YES :white_check_mark:" | ||
| else | ||
| result="Documentation built: NO :x:" | ||
| fi | ||
| echo "$result" | ||
| summary_content+="$result\n" | ||
|
|
||
| # Check broken links in linkcheck | ||
| linkcheck_file_path='./libraries/dl-streamer/docs/build-linkcheck/output.txt' | ||
| broken_count=$(grep -o '\[broken\]' "$linkcheck_file_path" | wc -l) | ||
| if [ "$broken_count" -eq 0 ]; then | ||
| result="Broken links: $broken_count :white_check_mark:" | ||
| else | ||
| result="Broken links: $broken_count :x:" | ||
| fi | ||
| echo "$result" | ||
| summary_content+="$result\n" | ||
|
|
||
| # Spelling | ||
| result="Spelling: check report from artifacts" | ||
| echo "$result" | ||
| summary_content+="$result\n" | ||
|
|
||
| echo -e "$summary_content" >> $GITHUB_STEP_SUMMARY | ||
|
|
||
| - name: Upload linkcheck report | ||
| uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 #4.6.2 | ||
| if: always() | ||
| with: | ||
| name: docs_linkcheck_report | ||
| path: ./libraries/dl-streamer/docs/build-linkcheck/ | ||
|
|
||
| - name: Upload spelling report | ||
| uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 #4.6.2 | ||
| if: always() | ||
| with: | ||
| name: docs_spelling_report | ||
| path: ./libraries/dl-streamer/docs/build-spelling/ | ||
|
|
||
| - name: Upload pages | ||
| uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 #4.6.2 | ||
| if: always() | ||
| with: | ||
| name: docs_site | ||
| path: ./libraries/dl-streamer/docs/build-html | ||
|
|
||
| - name: Clean up | ||
| if: always() | ||
| run: | | ||
| rm -rf edge-ai-libraries-repo | ||
This file contains hidden or 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,4 +1,4 @@ | ||
| build** | ||
| build**/ | ||
|
|
||
| source/_doxygen/src/ | ||
| source/_doxygen/src-api2.0/ | ||
|
|
||
This file contains hidden or 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,65 @@ | ||
| #!/bin/bash | ||
| # ============================================================================== | ||
| # Copyright (C) 2022-2025 Intel Corporation | ||
| # | ||
| # SPDX-License-Identifier: MIT | ||
| # ============================================================================== | ||
|
|
||
| IMAGE_NAME=${1:-"sphinx-docs:latest"} | ||
| CONTAINER_NAME=${2:-docs_pages} | ||
| DOCKER_PRIVATE_REGISTRY=${3:-""} | ||
|
|
||
| ROOT="$(realpath "$(dirname "${0}")"/..)" | ||
| DOCS_DIR=$ROOT/docs | ||
| DOXYGEN_DIR=$ROOT/docs/source/_doxygen | ||
| IMAGE_DOCS_DIR=/root/docs | ||
|
|
||
| # Copy necessary files located outside of this folder | ||
| echo "::group::Prepare for docker build" | ||
| cp -r "$ROOT"/samples/model_index.yaml "$DOCS_DIR" | ||
| cp -r "$ROOT"/samples/verified_models.json "$DOCS_DIR" | ||
| mkdir -p "$DOXYGEN_DIR"/src | ||
| cp -r "$ROOT"/gst-libs/gst/videoanalytics "$ROOT"/python/gstgva "$ROOT"/include/dlstreamer/gst/metadata "$DOXYGEN_DIR"/src | ||
| mkdir -p "$DOXYGEN_DIR"/src-api2.0 | ||
| cp -r "$ROOT"/include/dlstreamer "$DOXYGEN_DIR"/src-api2.0 | ||
| echo "::endgroup::" | ||
|
|
||
| # Build docker image | ||
| echo "::group::Building docker image" | ||
| docker_build="docker build \ | ||
| -f $DOCS_DIR/_docker/Dockerfile \ | ||
| -t $IMAGE_NAME \ | ||
| --build-arg DOCKER_PRIVATE_REGISTRY=$DOCKER_PRIVATE_REGISTRY \ | ||
| --build-arg DOCS_DIR=$IMAGE_DOCS_DIR \ | ||
| $DOCS_DIR" | ||
| echo "$docker_build" | ||
| if ! $docker_build ; then | ||
| echo "::error::docker build failed" | ||
| exit 1 | ||
| fi | ||
| echo "::endgroup::" | ||
|
|
||
| echo "::group::Removing container" | ||
| docker container rm "$CONTAINER_NAME" | ||
| echo "::endgroup::" | ||
|
|
||
| # Building | ||
| echo "Building..." | ||
| BUILD_TYPES="html,spelling,linkcheck" | ||
| docker run --name "$CONTAINER_NAME" "$IMAGE_NAME" ./scripts/sphinx_build.sh "$BUILD_TYPES" | ||
| RUN_RESULT=$? | ||
|
|
||
| echo "::group::Gathering build result" | ||
| IFS=',' read -ra BUILDS <<< "$BUILD_TYPES" | ||
| for btype in "${BUILDS[@]}"; do | ||
| build_dir="build-$btype" | ||
| rm -rf "$build_dir" | ||
| # Copy | ||
| docker cp "$CONTAINER_NAME":$IMAGE_DOCS_DIR/"$build_dir" "$DOCS_DIR" | ||
| # Remove non-relevant things | ||
| rm -rf "$DOCS_DIR"/"$build_dir"/.buildinfo "$DOCS_DIR"/"$build_dir"/.doctrees/ | ||
| done | ||
| echo "::endgroup::" | ||
|
|
||
| echo "Done, exit code $RUN_RESULT" | ||
| exit $RUN_RESULT |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.