-
Notifications
You must be signed in to change notification settings - Fork 120
85 lines (74 loc) · 2.45 KB
/
Copy pathbuild-docs-linux.yml
File metadata and controls
85 lines (74 loc) · 2.45 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
name: build docs (linux)
defaults:
run:
shell: bash -l -exo pipefail {0}
on:
workflow_dispatch:
pull_request:
paths:
- "docs/**"
- "python/**"
- "CMakeLists.txt"
- "cmake/**"
- ".github/workflows/build-docs-linux.yml"
push:
branches:
- main
permissions:
contents: read
jobs:
build-docs:
if: github.repository == 'oleksandr-pavlyk/nvbench'
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Miniconda
uses: conda-incubator/setup-miniconda@v3
with:
miniforge-version: "latest"
channels: conda-forge
conda-remove-defaults: true
auto-activate: false
- name: Create docs environment
run: conda create -n nvbench-docs --yes python pip doxygen cuda-nvcc_linux-64 gcc_linux-64 gxx_linux-64 cuda-nvml-dev cuda-profiler-api cmake ninja
- name: Install Python dependencies
run: |
conda activate nvbench-docs
pip install breathe sphinx nvidia-sphinx-theme myst-parser docutils
pip install cython scikit-build-core setuptools-scm typing-extensions cuda-bindings
- name: Build/Install cuda.bench
run: |
conda activate nvbench-docs
cd python
rm -rf build
python -m pip install --no-build-isolation --no-deps --verbose .
- name: Build documentation
run: |
conda activate nvbench-docs
cd docs
./build_combined_docs.sh
- name: Upload documentation artifact
uses: actions/upload-artifact@v4
with:
name: docs-html
path: docs/sphinx-combined/_build
comment-docs:
if: github.repository == 'oleksandr-pavlyk/nvbench' && github.event_name == 'pull_request'
needs: build-docs
runs-on: ubuntu-latest
permissions:
pull-requests: write
steps:
- name: Comment on pull request with artifact link
uses: actions/github-script@v7
with:
script: |
const runUrl = `${context.serverUrl}/${context.repo.owner}/${context.repo.repo}/actions/runs/${context.runId}`;
const body = `Documentation artifact "docs-html" is available for this run: ${runUrl}`;
await github.rest.issues.createComment({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.issue.number,
body,
});