diff --git a/.github/workflows/docs-build.yaml b/.github/workflows/docs-build.yaml new file mode 100644 index 0000000..cc24482 --- /dev/null +++ b/.github/workflows/docs-build.yaml @@ -0,0 +1,73 @@ +on: + workflow_call: + inputs: + build_type: + required: true + type: string + branch: + type: string + date: + type: string + sha: + type: string + repo: + type: string + node_type: + type: string + default: "cpu8" + script: + type: string + default: "ci/build_docs.sh" + +defaults: + run: + shell: bash + +permissions: + actions: read + checks: none + contents: read + deployments: none + discussions: none + id-token: write + issues: none + packages: read + pages: none + pull-requests: read + repository-projects: none + security-events: none + statuses: none + +jobs: + build: + strategy: + fail-fast: false + runs-on: "linux-amd64-cpu4" + env: + RAPIDS_ARTIFACTS_DIR: ${{ github.workspace }}/artifacts + container: + image: rapidsai/ci-conda:cuda12.5.1-ubuntu22.04-py3.11 + env: + RAPIDS_BUILD_TYPE: ${{ inputs.build_type }} + steps: + - uses: actions/checkout@v4 + with: + repository: ${{ inputs.repo }} + ref: ${{ inputs.sha }} + fetch-depth: 0 + - name: Standardize repository information + run: | + echo "RAPIDS_REPOSITORY=${{ inputs.repo || github.repository }}" >> "${GITHUB_ENV}" + echo "RAPIDS_SHA=$(git rev-parse HEAD)" >> "${GITHUB_ENV}" + echo "RAPIDS_REF_NAME=${{ inputs.branch || github.ref_name }}" >> "${GITHUB_ENV}" + echo "RAPIDS_NIGHTLY_DATE=${{ inputs.date }}" >> "${GITHUB_ENV}" + - name: Docs build + run: ${{ inputs.script }} + env: + GH_TOKEN: ${{ github.token }} + - name: Upload docs + if: "!cancelled()" + uses: actions/upload-artifact@v4 + with: + name: docs + path: "docs/html" diff --git a/.github/workflows/pr.yaml b/.github/workflows/pr.yaml index 15a5f40..124e056 100644 --- a/.github/workflows/pr.yaml +++ b/.github/workflows/pr.yaml @@ -21,6 +21,7 @@ jobs: - test-conda - build-wheels - test-wheels + - build-docs secrets: inherit uses: rapidsai/shared-workflows/.github/workflows/pr-builder.yaml@branch-24.08 checks: @@ -73,3 +74,7 @@ jobs: build_type: pull-request script: "ci/test_wheel.sh" matrix_filter: ${{ needs.compute-matrix.outputs.TEST_MATRIX }} + build-docs: + uses: ./.github/workflows/docs-build.yaml + with: + build_type: pull-request diff --git a/ci/build_docs.sh b/ci/build_docs.sh new file mode 100755 index 0000000..51dae8d --- /dev/null +++ b/ci/build_docs.sh @@ -0,0 +1,42 @@ +#!/bin/bash +# Copyright (c) 2024, NVIDIA CORPORATION + +set -euo pipefail + +. /opt/conda/etc/profile.d/conda.sh + +rapids-logger "Install testing dependencies" +# TODO: Replace with rapids-dependency-file-generator +rapids-mamba-retry create -n docs \ + make \ + psutil \ + sphinx \ + sphinx_rtd_theme \ + python=${RAPIDS_PY_VERSION} + +# Temporarily allow unbound variables for conda activation. +set +u +conda activate test +set -u + +package=$(realpath conda-package/numba-cuda-*.tar.bz2) +echo "Package path: $package" +rapids-mamba-retry install $package + +rapids-print-env + +rapids-logger "Show Numba system info" +python -m numba --sysinfo + +EXITCODE=0 +trap "EXITCODE=1" ERR +set +e + +rapids-logger "Build docs" +pushd docs +make html + +popd + +rapids-logger "Test script exiting with value: $EXITCODE" +exit ${EXITCODE}