Skip to content

Commit b07d497

Browse files
assignUserfacebook-github-bot
authored andcommitted
Move Documentation Job to GHA (facebookincubator#8718)
Summary: This PR moves the doc gen job to gha. There are some minor changes compared to the original job: - it uses the built-in `GITHUB_TOKEN` so it will no longer be necessary to keep an SSH key with full write access around. - The key currently used by CCI should be deleted once this is merged. - only runs when changes happen in velox/docs - runs in relevant PRs and uploads the generated docs as a shortlived artifact for easier review - I removed the pyvelox build for now as the the API documentation wasn't generated/used. We can add this in when we want to use it, until then it's just wasted CI time. I have also added a `dependabot.yml` to enable dependabot for Github Actions updates (this might need to be enabled in the repo settings). To avoid supply chain attacks via force pushed tag of actions we want to pin actions to a specific SHA when using actions in privileged workflows with permissions (e.g. `contents: write`) or that expose secrets. Dependabot will open PRs to update these SHAs (and the normal version tags) Pull Request resolved: facebookincubator#8718 Reviewed By: xiaoxmeng Differential Revision: D54315010 Pulled By: kgpai fbshipit-source-id: 4d284fe01352ec3c5191f6ff3748b13e2434bba3
1 parent fb48774 commit b07d497

File tree

3 files changed

+106
-47
lines changed

3 files changed

+106
-47
lines changed

.circleci/dist_compile.yml

-47
Original file line numberDiff line numberDiff line change
@@ -425,43 +425,6 @@ jobs:
425425
fuzzer_exe: "_build/debug/velox/exec/tests/velox_join_fuzzer_test"
426426
fuzzer_args: " --seed ${RANDOM} --duration_sec 3600 --logtostderr=1 --minloglevel=0"
427427

428-
doc-gen-job:
429-
executor: build
430-
steps:
431-
- checkout
432-
- update-submodules
433-
- add_ssh_keys:
434-
fingerprints:
435-
- "7b:24:f3:1a:b1:15:97:c6:fe:06:46:27:3e:b7:6b:96"
436-
- run:
437-
name: "Build docs and update gh-pages"
438-
command: |
439-
for i in {1..3}; do
440-
make clean
441-
git config --global user.email "velox@users.noreply.github.com"
442-
git config --global user.name "velox"
443-
git checkout main
444-
conda init bash
445-
source ~/.bashrc
446-
conda create -y --name docgenenv python=3.7
447-
conda activate docgenenv
448-
pip install sphinx sphinx-tabs breathe sphinx_rtd_theme chardet
449-
source /opt/rh/gcc-toolset-9/enable
450-
./scripts/gen-docs.sh docgenenv
451-
git checkout gh-pages
452-
cp -R velox/docs/_build/html/* docs
453-
git add docs
454-
if [ -n "$(git status --porcelain --untracked-files=no)" ]
455-
then
456-
git commit -m "Update documentation"
457-
git push
458-
if [ $? -eq 0 ]; then
459-
break;
460-
fi
461-
fi
462-
done
463-
464-
465428
linux-pr-fuzzer-run:
466429
executor: build
467430
steps:
@@ -566,11 +529,6 @@ workflows:
566529
- linux-build-options
567530
- linux-adapters
568531
- linux-presto-fuzzer-run
569-
- doc-gen-job:
570-
filters:
571-
branches:
572-
only:
573-
- main
574532

575533
shorter-fuzzer:
576534
unless: << pipeline.parameters.run-longer-expression-fuzzer >>
@@ -579,8 +537,3 @@ workflows:
579537
- linux-pr-fuzzer-run
580538
- linux-build-options
581539
- linux-adapters
582-
- doc-gen-job:
583-
filters:
584-
branches:
585-
only:
586-
- main

.github/dependabot.yml

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# Copyright (c) Facebook, Inc. and its affiliates.
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
version: 2
16+
updates:
17+
- package-ecosystem: "github-actions"
18+
directory: "/"
19+
schedule:
20+
interval: "weekly"
21+

.github/workflows/docs.yml

+85
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
# Copyright (c) Facebook, Inc. and its affiliates.
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
name: Update Documentation
16+
17+
on:
18+
push:
19+
paths:
20+
- "velox/docs/**"
21+
- ".github/workflows/docs.yml"
22+
23+
pull_request:
24+
paths:
25+
- "velox/docs/**"
26+
- ".github/workflows/docs.yml"
27+
28+
permissions:
29+
contents: write
30+
31+
concurrency:
32+
group: ${{ github.workflow }}-${{ github.repository }}-${{ github.head_ref || github.sha }}
33+
cancel-in-progress: true
34+
35+
jobs:
36+
build_docs:
37+
name: Build and Push
38+
runs-on: ubuntu-latest
39+
steps:
40+
41+
- name: Checkout
42+
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
43+
with:
44+
fetch-depth: 0
45+
46+
- name: Setup Git User
47+
run: |
48+
git config --global user.email "velox@users.noreply.github.com"
49+
git config --global user.name "velox"
50+
51+
- name: Install Dependencies
52+
run: |
53+
sudo apt update
54+
sudo apt install -y pandoc
55+
pip install sphinx sphinx-tabs breathe sphinx_rtd_theme chardet
56+
57+
- name: Build Documentation
58+
run: |
59+
cd velox/docs
60+
make clean
61+
# pyvelox
62+
mkdir -p bindings/python
63+
pandoc ../../pyvelox/README.md --from markdown --to rst -s -o bindings/python/README_generated_pyvelox.rst
64+
# velox
65+
make html
66+
67+
- name: Push Documentation
68+
if: ${{ github.event_name == 'push' && github.repository == 'facebookincubator/velox'}}
69+
run: |
70+
git checkout gh-pages
71+
cp -R velox/docs/_build/html/* docs
72+
git add docs
73+
74+
if [ -n "$(git status --porcelain --untracked-files=no)" ]
75+
then
76+
git commit -m "Update documentation"
77+
git push
78+
fi
79+
80+
- name: Upload Documentation
81+
if: github.event_name == 'pull_request'
82+
uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 # v4.3.1
83+
with:
84+
path: velox/docs/_build/html
85+
retention-days: 3

0 commit comments

Comments
 (0)