-
Notifications
You must be signed in to change notification settings - Fork 184
[DOCS] Add new documentation checks to align with other OEP repositories #691
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,85 @@ | ||||||||||
| --- | ||||||||||
| # SPDX-FileCopyrightText: (C) 2025 Intel Corporation | ||||||||||
| # SPDX-License-Identifier: Apache-2.0 | ||||||||||
|
|
||||||||||
| name: "Build Documentation" | ||||||||||
|
|
||||||||||
| on: # yamllint disable-line rule:truthy rule:line-length | ||||||||||
| workflow_call: | ||||||||||
| inputs: | ||||||||||
| docs_directory: | ||||||||||
| description: >- | ||||||||||
| Documentation directory where the job will run, defaults to '.' | ||||||||||
| required: false | ||||||||||
| default: "." | ||||||||||
| type: string | ||||||||||
| simple_mode: | ||||||||||
| description: >- | ||||||||||
| When true, override configuration for simple documentation sites | ||||||||||
| required: false | ||||||||||
| default: true | ||||||||||
| type: boolean | ||||||||||
| exclude_patterns: | ||||||||||
| description: >- | ||||||||||
| Comma separated list of exclude patterns to use during the build, | ||||||||||
| defaults to empty list | ||||||||||
| required: false | ||||||||||
| default: "" | ||||||||||
| type: string | ||||||||||
|
|
||||||||||
| permissions: | ||||||||||
| contents: read | ||||||||||
|
|
||||||||||
| jobs: | ||||||||||
| build-documentation: | ||||||||||
| permissions: | ||||||||||
| contents: read # minimal privilege required | ||||||||||
| runs-on: ubuntu-latest | ||||||||||
| env: | ||||||||||
| DOCS_DIR: ${{ inputs.docs_directory }} | ||||||||||
| steps: | ||||||||||
| - name: Checkout code | ||||||||||
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | ||||||||||
| with: | ||||||||||
| # Fetch all history, otherwise sporadic issue with missing tags | ||||||||||
| fetch-depth: 0 | ||||||||||
| # Fetch tags | ||||||||||
| fetch-tags: true | ||||||||||
| # Checkout the branch that triggered the workflow | ||||||||||
| # to avoid detached HEAD | ||||||||||
| ref: ${{ github.event.pull_request.head.sha || github.head_ref }} | ||||||||||
| persist-credentials: false | ||||||||||
|
|
||||||||||
| - name: Download template | ||||||||||
| if: ${{ inputs.simple_mode }} | ||||||||||
| shell: bash | ||||||||||
| run: | | ||||||||||
| cd "${GITHUB_WORKSPACE}/${DOCS_DIR}" | ||||||||||
| wget https://docs.openedgeplatform.intel.com/template/template.tar.gz | ||||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please consider adding error handling and checksum verification for the downloaded tarball:
Suggested change
|
||||||||||
| # Override any existing files with template | ||||||||||
| tar xf template.tar.gz | ||||||||||
| if [ -f "dictionary_append.txt" ]; then | ||||||||||
| cat "dictionary_append.txt" >> "dict.txt" | ||||||||||
| fi | ||||||||||
|
|
||||||||||
| - name: Add exclude patterns | ||||||||||
| env: | ||||||||||
| EXCLUDE: ${{ inputs.exclude_patterns }} | ||||||||||
| shell: bash | ||||||||||
| run: | | ||||||||||
| # Remove any spaces | ||||||||||
| exclude_no_spaces="${EXCLUDE// /}" | ||||||||||
| # Surround patterns with quotes and create Python list | ||||||||||
| exclude_pattern="[\"${exclude_no_spaces//,/\", \"}\"]" | ||||||||||
| conf_files=$(find "${GITHUB_WORKSPACE}" -type f -path "*/docs/conf.py") | ||||||||||
| for conf_file in $conf_files; do | ||||||||||
| echo "exclude_patterns.extend(${exclude_pattern})" >> "$conf_file" | ||||||||||
| done | ||||||||||
|
|
||||||||||
| - name: Build Documentation | ||||||||||
| env: | ||||||||||
| SIMPLE_MODE: ${{ inputs.simple_mode }} | ||||||||||
| shell: bash | ||||||||||
| run: | | ||||||||||
| cd "${GITHUB_WORKSPACE}/${DOCS_DIR}" | ||||||||||
| make build | ||||||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,41 @@ | ||
| --- | ||
| # SPDX-FileCopyrightText: (C) 2025 Intel Corporation | ||
| # SPDX-License-Identifier: Apache-2.0 | ||
|
|
||
| name: Documentation Check | ||
|
|
||
| on: # yamllint disable-line rule:truthy | ||
| pull_request: | ||
| branches: | ||
| - main | ||
| workflow_dispatch: | ||
|
|
||
| permissions: {} | ||
|
|
||
| jobs: | ||
| filter: | ||
| permissions: | ||
| contents: read # needed for actions/checkout | ||
| runs-on: ubuntu-latest | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. please change runner group to dlstreamer |
||
| outputs: | ||
| dlstreamer_documentation_changed: ${{ steps.filter.outputs.dlstreamer_documentation }} | ||
| steps: | ||
| - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | ||
| with: | ||
| persist-credentials: false | ||
| - name: Set paths filter | ||
| id: filter | ||
| uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. please update version to v4.0.1 and add comment with this version: |
||
| with: | ||
| filters: | | ||
| dlstreamer_documentation: | ||
| - 'docs/user-guide/**' | ||
| build-dlstreamer-documentation: | ||
| permissions: | ||
| contents: read # needed for actions/checkout | ||
| needs: filter | ||
| if: ${{ needs.filter.outputs.dlstreamer_documentation_changed == 'true' }} | ||
| uses: ./.github/workflows/docs-reusable-workflow.yaml | ||
| with: | ||
| docs_directory: . | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please check whether this version v6.0.2 is right