-
Notifications
You must be signed in to change notification settings - Fork 2
Add shared workflow for build docs #2
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
7afb0ef
Add workflow for build docs
Czaki 2791a14
trigger workflow on PR
Czaki aa97043
add target selection
Czaki 69fa8bb
change artifact name
Czaki 7c06f2f
Update .github/workflows/build_PR.yml
Czaki fb4249c
Apply suggestions from code review
Czaki 3ba0950
fix setup uv
Czaki 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,17 @@ | ||
| name: Build Docs (Self) | ||
|
|
||
| on: | ||
| pull_request: | ||
| paths: | ||
| - '.github/workflows/build_docs.yml' | ||
| - '.github/workflows/build_PR.yml' | ||
|
|
||
|
|
||
| jobs: | ||
| build-docs: | ||
| uses: ./.github/workflows/build_docs.yml | ||
| with: | ||
| main-repo: napari/napari | ||
| main-ref: main | ||
| docs-repo: napari/docs | ||
| docs-ref: main |
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,87 @@ | ||
| name: Build PR Docs | ||
|
|
||
| on: | ||
| workflow_call: | ||
| inputs: | ||
| main-repo: | ||
| required: true | ||
| type: string | ||
| description: 'The main code repository (e.g. napari/napari or napari/docs)' | ||
| main-ref: | ||
| required: true | ||
| type: string | ||
| description: 'The ref (branch/sha) to use for the main repo (e.g. PR branch or main)' | ||
| docs-repo: | ||
| required: true | ||
| type: string | ||
| description: 'The docs repository (e.g. napari/docs)' | ||
| docs-ref: | ||
| required: true | ||
| type: string | ||
| description: 'The ref (branch/sha) to use for the docs repo (e.g. PR branch or main)' | ||
| make_target: | ||
| description: "Enter make target: html html-noplot docs slimfast slimgallery" | ||
| type: string | ||
| default: "slimfast" | ||
| workflow_dispatch: | ||
|
|
||
| jobs: | ||
| build-and-upload: | ||
| name: Build & Upload Docs Artifact | ||
| runs-on: ubuntu-latest | ||
| env: | ||
| XDG_CACHE_HOME: ${{ github.workspace }}/.cache | ||
| steps: | ||
| - name: Checkout docs repo | ||
| uses: actions/checkout@v5 | ||
| with: | ||
| repository: ${{ inputs.docs-repo }} | ||
| ref: ${{ inputs.docs-ref }} | ||
| path: docs | ||
| - name: Checkout main repo | ||
| uses: actions/checkout@v5 | ||
| with: | ||
| repository: ${{ inputs.main-repo }} | ||
| ref: ${{ inputs.main-ref }} | ||
| path: napari | ||
| - name: Install the latest version of uv | ||
| uses: astral-sh/setup-uv@v6 | ||
| with: | ||
| version: "latest" | ||
| python-version: '3.12' | ||
| activate-environment: true | ||
| - name: Cache pooch downloads | ||
| uses: actions/cache@v4 | ||
| with: | ||
| path: | | ||
| ${{ github.workspace }}/.cache/scikit-image | ||
| ${{ github.workspace }}/.cache/napari-* | ||
| ${{ github.workspace }}/.cache/pooch | ||
| key: pooch | ||
| - name: Setup headless display | ||
| uses: pyvista/setup-headless-display-action@v4.2 | ||
| with: | ||
| qt: true | ||
| wm: herbstluftwm | ||
| - name: Install dependencies | ||
|
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. Can we use uv in these builds? |
||
| run: | | ||
| uv pip install --upgrade pip | ||
| uv pip install "napari/[pyqt5]" --group napari/pyproject.toml:docs | ||
| env: | ||
| UV_CONSTRAINT: ${{ github.workspace }}/napari/resources/constraints/constraints_py3.12_docs.txt | ||
| - name: Test import | ||
| run: | | ||
| python -c 'import napari; print(napari.__version__)' | ||
| python -c 'import napari.layers; print(napari.layers.__doc__)' | ||
| - name: Build docs | ||
| run: make -C docs ${{ inputs.make_target }} | ||
| env: | ||
| GOOGLE_CALENDAR_ID: ${{ secrets.GOOGLE_CALENDAR_ID }} | ||
| GOOGLE_CALENDAR_API_KEY: ${{ secrets.GOOGLE_CALENDAR_API_KEY }} | ||
| PIP_CONSTRAINT: ${{ github.workspace }}/napari/resources/constraints/constraints_py3.12_docs.txt | ||
Czaki marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| UV_CONSTRAINT: ${{ github.workspace }}/napari/resources/constraints/constraints_py3.12_docs.txt | ||
| - name: Upload artifact | ||
| uses: actions/upload-artifact@v4 | ||
| with: | ||
| name: html | ||
| path: docs/docs/_build/html | ||
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.