Revise docs building CI workflow #23
Workflow file for this run
  
    
      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
    
  
  
    
  | name: Docs | |
| on: | |
| push: | |
| branches: [ main ] | |
| pull_request: | |
| permissions: | |
| id-token: write | |
| contents: write | |
| defaults: | |
| run: | |
| shell: bash -l -eo pipefail {0} | |
| jobs: | |
| build-docs: | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| python-version: ['3.10'] | |
| cuda-version: ['12.6'] | |
| ffmpeg-version: ['7'] | |
| runs-on: linux.g5.4xlarge.nvidia.gpu | |
| steps: | |
| - name: Setup env vars | |
| run: | | |
| cuda_version_without_periods=$(echo "${{ matrix.cuda-version }}" | sed 's/\.//g') | |
| echo cuda_version_without_periods=${cuda_version_without_periods} >> $GITHUB_ENV | |
| python_version_without_periods=$(echo "${{ matrix.python-version }}" | sed 's/\.//g') | |
| echo python_version_without_periods=${python_version_without_periods} >> $GITHUB_ENV | |
| - name: Setup miniconda using test-infra | |
| uses: pytorch/test-infra/.github/actions/setup-miniconda@main | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| # We install conda packages at the start because otherwise conda may have conflicts with dependencies. | |
| default-packages: "nvidia/label/cuda-${{ matrix.cuda-version }}.0::libnpp nvidia::cuda-nvrtc=${{ matrix.cuda-version }} nvidia::cuda-toolkit=${{ matrix.cuda-version }} nvidia::cuda-cudart=${{ matrix.cuda-version }} nvidia::cuda-driver-dev=${{ matrix.cuda-version }} conda-forge::ffmpeg=${{ matrix.ffmpeg-version }} cmake ninja" | |
| - uses: pytorch/test-infra/.github/actions/setup-binary-builds@main | |
| with: | |
| setup-miniconda: false | |
| python-version: ${{ matrix.python-version }} | |
| cuda-version: ${{ matrix.cuda-version }} | |
| repository: "" | |
| - name: Check env | |
| run: | | |
| ${CONDA_RUN} env | |
| ${CONDA_RUN} conda info | |
| ${CONDA_RUN} nvidia-smi | |
| ${CONDA_RUN} conda list | |
| - name: Assert ffmpeg exists | |
| run: | | |
| ${CONDA_RUN} ffmpeg -buildconf | |
| - name: Update pip | |
| run: ${CONDA_RUN} python -m pip install --upgrade pip | |
| - name: Install PyTorch | |
| run: | | |
| ${CONDA_RUN} python -m pip install --pre torch torchcodec --index-url https://download.pytorch.org/whl/nightly/cu${{ env.cuda_version_without_periods }} | |
| ${CONDA_RUN} python -c 'import torch; print(f"{torch.__version__}"); print(f"{torch.__file__}"); print(f"{torch.cuda.is_available()=}")' | |
| - name: Check out repo | |
| uses: actions/checkout@v3 | |
| - name: Install torchaudio | |
| run: | | |
| export USE_CUDA=1 | |
| ${CONDA_RUN} python -m pip install . -v --no-build-isolation | |
| - name: Install doc dependencies | |
| run: | | |
| cd docs | |
| ${CONDA_RUN} python -m pip install -r requirements.txt -r requirements-tutorials.txt | |
| - name: Build docs | |
| run: | | |
| cd docs | |
| ${CONDA_RUN} make html | |
| - uses: actions/upload-artifact@v4 | |
| with: | |
| name: Built-Docs | |
| path: docs/build/html/ |