Skip to content

Commit

Permalink
Add docs build to CI
Browse files Browse the repository at this point in the history
  • Loading branch information
gmarkall committed Aug 1, 2024
1 parent 9dfaaa1 commit 787901a
Show file tree
Hide file tree
Showing 3 changed files with 120 additions and 0 deletions.
73 changes: 73 additions & 0 deletions .github/workflows/docs-build.yaml
Original file line number Diff line number Diff line change
@@ -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"
5 changes: 5 additions & 0 deletions .github/workflows/pr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ jobs:
- test-conda
- build-wheels
- test-wheels
- build-docs
secrets: inherit
uses: rapidsai/shared-workflows/.github/workflows/[email protected]
checks:
Expand Down Expand Up @@ -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
42 changes: 42 additions & 0 deletions ci/build_docs.sh
Original file line number Diff line number Diff line change
@@ -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}

0 comments on commit 787901a

Please sign in to comment.