-
Notifications
You must be signed in to change notification settings - Fork 13
121 lines (102 loc) · 4.06 KB
/
ci_docs.yml
File metadata and controls
121 lines (102 loc) · 4.06 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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
# SPDX-FileCopyrightText: Copyright (c) 2025-2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# SPDX-License-Identifier: Apache-2.0
name: Documentation
on:
workflow_call:
inputs:
ref_type:
description: 'The ref type from the triggering workflow'
required: true
type: string
ref_name:
description: 'The ref name from the triggering workflow'
required: true
type: string
publish_docs:
description: 'Whether to upload a GitHub Pages artifact for deployment'
required: false
default: false
type: boolean
defaults:
run:
shell: bash
env:
GH_TOKEN: "${{ github.token }}"
GIT_COMMIT: "${{ github.sha }}"
NEMO_FLOW_CI_WORKSPACE: "${{ github.workspace }}"
NEMO_FLOW_CI_WORKSPACE_TMP: "${{ github.workspace }}/tmp"
UV_PYTHON_DOWNLOADS: never
jobs:
docs:
name: Build
runs-on: ubuntu-latest
timeout-minutes: 60
permissions:
contents: read
steps:
- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
with:
fetch-depth: 0
- name: Load CI tool versions
id: ci-config
uses: ./.github/actions/load-ci-tool-versions
- uses: astral-sh/setup-uv@cec208311dfd045dd5311c1add060b2062131d57 # v8
with:
version: ${{ steps.ci-config.outputs.uv_version }}
enable-cache: true
cache-dependency-glob: ${{ env.NEMO_FLOW_CI_WORKSPACE }}/uv.lock
- uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6
with:
node-version: ${{ steps.ci-config.outputs.node_version }}
- uses: actions-rust-lang/setup-rust-toolchain@150fca883cd4034361b621bd4e6a9d34e5143606 # v1.15.4
with:
cache: false
toolchain: ${{ steps.ci-config.outputs.rust_version }}
rustflags: ""
- uses: Swatinem/rust-cache@c19371144df3bb44fab255c43d04cbc2ab54d1c4 # v2.9.1
with:
shared-key: nemo-flow-rust-${{ runner.os }}-${{ runner.arch }}-${{ steps.ci-config.outputs.rust_version }}
workspaces: . -> target
cache-all-crates: true
cache-bin: false
save-if: false
- name: Install managed Python
run: |
set -e
UV_PYTHON_DOWNLOADS=manual uv python install --managed-python ${{ steps.ci-config.outputs.default_python_version }}
- uses: taiki-e/install-action@c070f87102a1c75b3183910f391c1cb887fe13c8 # v2.77.6
with:
tool: just@${{ steps.ci-config.outputs.just_version }},sphinx-rustdocgen@1.0.1
- name: Install Documentation Dependencies
working-directory: ${{ env.NEMO_FLOW_CI_WORKSPACE }}
run: uv sync --no-default-groups --group docs --no-install-project
- name: Install Node.js Documentation Dependencies
working-directory: ${{ env.NEMO_FLOW_CI_WORKSPACE }}
run: npm ci --ignore-scripts
- name: Materialize Main Branch For Versioned Docs
if: ${{ inputs.ref_type == 'tag' }}
working-directory: ${{ env.NEMO_FLOW_CI_WORKSPACE }}
run: git fetch --force origin +refs/heads/main:refs/heads/main
- name: Check Documentation Links
working-directory: ${{ env.NEMO_FLOW_CI_WORKSPACE }}
env:
NEMO_FLOW_DOCS_DEPS_READY: "1"
run: just docs-linkcheck
- name: Build Documentation Site
if: ${{ startsWith(inputs.ref_name, 'pull-request/') || inputs.ref_name == 'main' }}
working-directory: ${{ env.NEMO_FLOW_CI_WORKSPACE }}
env:
NEMO_FLOW_DOCS_DEPS_READY: "1"
run: just docs
- name: Build Versioned Documentation Site
if: ${{ inputs.publish_docs }}
working-directory: ${{ env.NEMO_FLOW_CI_WORKSPACE }}
env:
NEMO_FLOW_DOCS_DEPS_READY: "1"
run: just docs-github-pages
- name: Upload GitHub Pages Artifact
if: ${{ inputs.publish_docs }}
uses: actions/upload-pages-artifact@fc324d3547104276b827a68afc52ff2a11cc49c9 # v5
with:
path: ${{ env.NEMO_FLOW_CI_WORKSPACE }}/docs/_build/pages