Documentation #270
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: Documentation | |
| on: | |
| workflow_call: | |
| inputs: | |
| deploy_docs: | |
| type: boolean | |
| default: false | |
| required: false | |
| cache_key_suffix: | |
| type: string | |
| default: '' | |
| required: false | |
| cudaq_repo: | |
| type: string | |
| default: '' | |
| required: false | |
| cudaq_ref: | |
| type: string | |
| default: '' | |
| required: false | |
| workflow_dispatch: | |
| inputs: | |
| deploy_docs: | |
| description: 'Deploy docs to GitHub Pages. Deployment only runs on main.' | |
| type: boolean | |
| default: true | |
| required: false | |
| push: | |
| branches: | |
| - main | |
| paths: | |
| - '.github/workflows/docs.yaml' | |
| - 'docs/**' | |
| - '**/*.cpp' | |
| - '**/*.h' | |
| - '**/*.py' | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.event_name }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| build: | |
| name: Build | |
| runs-on: ${{ startsWith(github.repository, 'NVIDIA/cudaqx') && 'linux-amd64-cpu8' || 'ubuntu-latest' }} | |
| container: ghcr.io/nvidia/cuda-quantum-devcontainer:amd64-cu12.6-gcc12-main | |
| permissions: | |
| actions: write | |
| contents: read | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| with: | |
| set-safe-directory: true | |
| # ======================================================================== | |
| # CUDA Quantum build | |
| # ======================================================================== | |
| - name: Get required CUDAQ version | |
| id: get-cudaq-version | |
| uses: ./.github/actions/get-cudaq-version | |
| with: | |
| repo: ${{ inputs.cudaq_repo }} | |
| ref: ${{ inputs.cudaq_ref }} | |
| - name: Get CUDAQ build | |
| uses: ./.github/actions/get-cudaq-build | |
| with: | |
| repo: ${{ steps.get-cudaq-version.outputs.repo }} | |
| ref: ${{ steps.get-cudaq-version.outputs.ref }} | |
| token: ${{ secrets.CUDAQ_ACCESS_TOKEN }} | |
| cache-key-suffix: ${{ inputs.cache_key_suffix }} | |
| platform: 'amd64-cu12' # Just choose one platform for docs | |
| # ======================================================================== | |
| # Build docs | |
| # ======================================================================== | |
| - name: Install requirements | |
| run: | | |
| apt update | |
| apt install -y --no-install-recommends \ | |
| gfortran libblas-dev doxygen | |
| python3 -m pip install IPython breathe enum_tools myst_parser nbsphinx \ | |
| sphinx_copybutton sphinx_inline_tabs sphinx_gallery sphinx_rtd_theme \ | |
| sphinx_reredirects "sphinx<9" sphinx_toolbox \ | |
| "cuquantum-python-cu12>=26.3.0" | |
| - name: Build docs | |
| run: | | |
| # Note: TRT decoder is disabled because all docs for the TRT decoder | |
| # are generated independently of the source code (no Doxygen | |
| # documentation). | |
| cmake -S . -B "build" \ | |
| -DCMAKE_BUILD_TYPE=Release \ | |
| -DCMAKE_C_COMPILER=gcc-12 \ | |
| -DCMAKE_CXX_COMPILER=g++-12 \ | |
| -DCUDAQ_DIR=/cudaq-install/lib/cmake/cudaq/ \ | |
| -DCUDAQX_ENABLE_LIBS="all" \ | |
| -DCUDAQX_INCLUDE_DOCS=ON \ | |
| -DCUDAQX_BINDINGS_PYTHON=ON \ | |
| -DCUDAQ_QEC_BUILD_TRT_DECODER=OFF | |
| cmake --build "build" --target docs | |
| # ======================================================================== | |
| - name: Upload | |
| uses: actions/upload-pages-artifact@v3 | |
| with: | |
| path: build/docs/build/ | |
| # Disable for now, re-enable closer to release. | |
| # deploy: | |
| # name: Deploy latest docs | |
| # if: | | |
| # github.ref == 'refs/heads/main' && | |
| # ( | |
| # github.event_name == 'push' || | |
| # inputs.deploy_docs == true | |
| # ) | |
| # environment: | |
| # name: github-pages | |
| # url: ${{ steps.deployment.outputs.page_url }} | |
| # runs-on: ubuntu-latest | |
| # permissions: | |
| # pages: write | |
| # id-token: write | |
| # needs: build | |
| # steps: | |
| # - name: Deploy to GitHub Pages | |
| # id: deployment | |
| # uses: actions/deploy-pages@v4 |