Skip to content

feat: adding docs change validation step in reuseable CI #390

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
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 44 additions & 0 deletions .github/workflows/reusable-build-test-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -321,6 +321,44 @@ jobs:
splunk_version_list=$(echo '${{ steps.determine_splunk.outputs.matrixSplunk }}' | jq -r '.[].version')
sc4s_version_list=$(echo '${{ steps.matrix.outputs.supportedSC4S }}' | jq -r '.[].version')
echo -e "## Summary of Versions Used\n- **Splunk versions used:** (${splunk_version_list})\n- **SC4S versions used:** (${sc4s_version_list})\n- Browser: Chrome" >> "$GITHUB_STEP_SUMMARY"

validate-docs-change:
runs-on: ubuntu-latest
container:
image: python:3.9
outputs:
status: ${{ steps.validate.outputs.status }}
steps:
- uses: actions/checkout@v4
with:
submodules: false
persist-credentials: false
- name: Installing requirements
run: |
pip install pip -U
pip install mkdocs==1.6.1 mkdocs-material==9.6.9 poetry
- name: validate
id: validate
run: |
if poetry run mkdocs build --strict; then
echo "status=success" >> "$GITHUB_OUTPUT"
echo "status :: success"
else
echo "status=failure" >> "$GITHUB_OUTPUT"
echo "status :: failure"
fi

enforce-docs-checks:
runs-on: ubuntu-latest
needs: validate-docs-change
if: github.ref == 'refs/heads/main' || github.event_name == 'pull_request'
steps:
- name: Fail if validate-docs-change failed
run: |
if [ "${{ needs.validate-docs-change.outputs.status }}" == "failure" ]; then
exit 1
fi

fossa-scan:
runs-on: ubuntu-latest
steps:
Expand Down Expand Up @@ -2956,6 +2994,7 @@ jobs:
- run-ucc-modinput-tests
- run-ui-tests
- validate-pr-title
- enforce-docs-checks
runs-on: ubuntu-latest
env:
NEEDS: ${{ toJson(needs) }}
Expand All @@ -2973,6 +3012,11 @@ jobs:
echo "run-publish=false" >> "$GITHUB_OUTPUT"
echo "Publish conditions are not met."
fi
if ${{ github.base_ref == 'main' }} && ${{ needs.enforce-docs-checks.result != 'success' }};
then
echo " There are documentation changes that break mkdocs deploy. please check validate-docs-change step."
exit 1
fi

publish:
if: ${{ !cancelled() && needs.pre-publish.outputs.run-publish == 'true' && (github.event_name == 'push' || needs.validate-custom-version.result == 'success') }}
Expand Down
Loading