-
Notifications
You must be signed in to change notification settings - Fork 7.2k
[PoC] migrate docs workflow to GHA #7407
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 11 commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
26cf7d8
[PoC] migrate docs workflow to GHA
pmeier 77db877
remove wrong id
pmeier 267e943
add ebug
pmeier 548a7ca
fix linker path
pmeier 98d4f56
try larger runner
pmeier 8010a12
limit number of parallel processes
pmeier b3ff0f9
single process
pmeier 2e71444
Merge branch 'main' into docs-gha
pmeier eb77d0f
try docs upload
pmeier 0620cf6
fix env var
pmeier 4506642
fix path
pmeier 7b0ebd2
Update .github/workflows/docs.yml
malfet 64f77ff
Update .github/workflows/docs.yml
malfet 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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
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
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,74 @@ | ||
| name: Docs | ||
|
|
||
| on: | ||
| pull_request: | ||
| push: | ||
| branches: | ||
| - nightly | ||
| - main | ||
| - release/* | ||
| workflow_dispatch: | ||
|
|
||
| jobs: | ||
| build: | ||
| uses: pytorch/test-infra/.github/workflows/linux_job.yml@main | ||
| with: | ||
| repository: pytorch/vision | ||
| upload-artifact: docs | ||
| script: | | ||
| set -euo pipefail | ||
|
|
||
| export PYTHON_VERSION=3.8 | ||
| export GPU_ARCH_TYPE=cpu | ||
| export GPU_ARCH_VERSION='' | ||
| ./.github/scripts/setup-env.sh | ||
|
|
||
| # Prepare conda | ||
| CONDA_PATH=$(which conda) | ||
| eval "$(${CONDA_PATH} shell.bash hook)" | ||
| conda activate ci | ||
| # FIXME: not sure why we need this. `ldd torchvision/video_reader.so` shows that it | ||
| # already links against the one pulled from conda. However, at runtime it pulls from | ||
| # /lib64 | ||
| # Should we maybe always do this in `./.github/scripts/setup-env.sh` so that we don't | ||
| # have to pay attention in all other workflows? | ||
| export LD_LIBRARY_PATH="${CONDA_PREFIX}/lib:${LD_LIBRARY_PATH}" | ||
|
|
||
| cd docs | ||
|
|
||
| echo '::group::Install doc requirements' | ||
| pip install --progress-bar=off -r requirements.txt | ||
| echo '::endgroup::' | ||
|
|
||
| echo '::group::Build HTML docs' | ||
| # The runner does not have sufficient memory to run with as many processes as their are | ||
| # cores (`-j auto`). Thus, we limit to a single process (`-j 1`) here. | ||
| sed -i -e 's/-j auto/-j 1/' Makefile | ||
| make html | ||
| echo '::endgroup::' | ||
|
|
||
| mv build/html "${RUNNER_ARTIFACT_DIR}" | ||
|
|
||
| upload-preview: | ||
| if: github.event_name == 'pull_request' | ||
| needs: [build] | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/download-artifact@v3 | ||
| with: | ||
| name: docs | ||
|
|
||
| - name: Debug | ||
| run: | | ||
| sudo apt -y update && sudo apt -y install tree | ||
| ls -la | ||
| tree html | ||
|
|
||
malfet marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| - name: Upload docs preview | ||
| uses: seemethere/upload-artifact-s3@v5 | ||
| with: | ||
| retention-days: 14 | ||
| s3-bucket: doc-previews | ||
| if-no-files-found: error | ||
| path: html | ||
| s3-prefix: pytorch/vision/${{ github.event.pull_request.number }} | ||
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.