Skip to content

ci: validate docs build on pull requests#191

Closed
framsouza wants to merge 1 commit intomistralai:mainfrom
framsouza:ci/validate-docs-on-pull-requests
Closed

ci: validate docs build on pull requests#191
framsouza wants to merge 1 commit intomistralai:mainfrom
framsouza:ci/validate-docs-on-pull-requests

Conversation

@framsouza
Copy link
Contributor

docs.yaml only ran on push to main, so broken docs weren't caught until after a PR was already merged, with this change the documentation errors are now caught before merge instead of after.

I split the single job into two:

deploy_docs: runs on push to main only, deploys to GitHub Pages as before. No behavior change here.
build_docs: runs on pull requests, builds with --strict to catch errors without deploying anything. Skips draft PRs.

Also replaced the manual actions/cache block with setup-uv's built-in caching to be consistent with how lint_build_test.yaml handles it after #190.

Testing

Tested the docs build with uv.

test output``` uv sync --all-extras --group docs uv pip install -e . --no-deps uv run mkdocs build --strict Resolved 118 packages in 27ms Audited 115 packages in 36ms Resolved 1 package in 8ms Built mistral-common @ file:///Users/framsouza-personal/mistral-common Prepared 1 package in 590ms Uninstalled 1 package in 0.95ms Installed 1 package in 2ms ~ mistral-common==1.9.1 (from file:///Users/framsouza-personal/mistral-common) INFO - Cleaning site directory INFO - Building documentation to directory: /Users/framsouza-personal/mistral-common/site INFO - Doc file 'usage/requests.md' contains a link '#transcription-request', but there is no such anchor on this page. INFO - Documentation built in 2.31 seconds ```

docs.yaml only triggered on push to main, meaning a PR could break
the documentation build and nobody would find out until after it merged.

Split the workflow into two jobs: deploy_docs runs on push to main and
publishes to GitHub Pages as before, build_docs runs on PRs and builds
with --strict to catch errors early.

Also renamed the workflow from 'Mistral Common CI' to 'Mistral Common
Docs' to avoid duplicate names in the Actions tab, and replaced the
manual actions/cache block with setup-uv's built-in caching to be
consistent with lint_build_test.yaml.
@abdelhadi703
Copy link
Contributor

This is a needed fix — catching doc build failures before they reach main is important. The separation of build_docs (PR validation) from deploy_docs (main-only deployment) is well-structured.

Also appreciate the switch from manual actions/cache to native setup-uv caching and the tighter permission scoping.

+1 for merging.

@juliendenize
Copy link
Contributor

It is actually handled by the other ci tests

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants