Skip to content

Commit 3dde67b

Browse files
committed
ci: add a rule for checking the SDK API obsolescence
1 parent e8b3002 commit 3dde67b

1 file changed

Lines changed: 36 additions & 0 deletions

File tree

.github/workflows/ci.yml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,42 @@ jobs:
180180
- name: "Validate generated documentation"
181181
run: "poetry run invoke docs-validate"
182182

183+
check-api-documentation-obsolescence:
184+
if: |
185+
always() && !cancelled() &&
186+
!contains(needs.*.result, 'failure') &&
187+
!contains(needs.*.result, 'cancelled') &&
188+
(needs.files-changed.outputs.python == 'true') || (needs.files-changed.outputs.documentation_generated == 'true')
189+
needs: ["prepare-environment", "files-changed", "yaml-lint", "python-lint"]
190+
runs-on: "ubuntu-22.04"
191+
env:
192+
DOCS_COMMAND: "poetry run invoke generate-sdk-api-docs"
193+
SDK_API_DOCS_DIR: "docs/docs/python-sdk/sdk_ref"
194+
timeout-minutes: 5
195+
steps:
196+
- name: "Check out repository code"
197+
uses: "actions/checkout@v4"
198+
with:
199+
submodules: true
200+
- name: Set up Python
201+
uses: actions/setup-python@v5
202+
with:
203+
python-version: "3.12"
204+
- name: "Setup Python environment"
205+
run: |
206+
pipx install poetry==${{ needs.prepare-environment.outputs.POETRY_VERSION }}
207+
poetry config virtualenvs.create true --local
208+
poetry env use 3.12
209+
- name: "Install dependencies"
210+
run: "poetry install --no-interaction --no-ansi --extras ctl"
211+
- name: "Setup environment"
212+
run: "pip install invoke toml"
213+
- name: "Generate SDK API documentation"
214+
run: ${{ env.DOCS_COMMAND }}
215+
- name: "Check if SDK API documentation needs to be refreshed"
216+
run: |
217+
git diff --quiet ${SDK_API_DOCS_DIR}
218+
183219
validate-documentation-style:
184220
if: |
185221
always() && !cancelled() &&

0 commit comments

Comments
 (0)