Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[skip-ci][ci][docu] Generate Doxygen docs with Makefile + GitHub Actions #15337

Draft
wants to merge 18 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
229 changes: 229 additions & 0 deletions .github/workflows/root-docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,229 @@
name: 'ROOT Docs'

on:
# https://github.com/root-project/root/pull/12112#issuecomment-1411004278
pull_request:
branches:
- '**'
paths-ignore:
- 'doc/**'
- 'documentation/**'

# Allows nightly builds to trigger one run for each branch easily, by
# providing the relevant branch as "default" value here:
workflow_call:
inputs:
head_ref:
type: string
default: master
base_ref:
type: string
default: master
ref_name:
type: string
default: master

workflow_dispatch:
inputs:
head_ref:
description: rebase from ...
type: string
required: true
default: master
base_ref:
description: ... to ... (can have same value)
type: string
required: true
default: master
incremental:
description: 'Do incremental build'
type: boolean
required: true
default: true
binaries:
description: Create binary packages and upload them as artifacts
type: boolean
required: true
default: false
buildtype:
description: The CMAKE_BUILD_TYPE to use for non-Windows.
type: choice
options:
- Debug
- RelWithDebInfo
- Release
- MinSizeRel
default: Debug
required: true
docu_input: # TODO: overwrite makeinput.sh with these args
description: Folders to build documentation for. All folders are built if empty.
type: string
default: ""
required: false

jobs:
build-docs:
runs-on:
- self-hosted
- linux
- x64

# TODO: it would be nice to use some global var for the platform, this doesn't work though :(
env:
PLATFORM: alma9
DOC_DIR: rootdoc
DOC_LOCATION: /github/home

permissions:
contents: read

container:
image: registry.cern.ch/root-ci/alma9:buildready # ALSO UPDATE BELOW!
options: '--security-opt label=disable --rm' # ALSO UPDATE BELOW!
env:
OS_APPLICATION_CREDENTIAL_ID: '7f5b64a265244623a3a933308569bdba'
OS_APPLICATION_CREDENTIAL_SECRET: ${{ secrets.OS_APPLICATION_CREDENTIAL_SECRET }}
OS_AUTH_TYPE: 'v3applicationcredential'
OS_AUTH_URL: 'https://keystone.cern.ch/v3'
OS_IDENTITY_API_VERSION: 3
OS_INTERFACE: 'public'
OS_REGION_NAME: 'cern'
PYTHONUNBUFFERED: true

steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Set up Python Virtual Env
# if the `if` expr is false, `if` still has exit code 0.
# if the `if` block is entered, the block's exit code becomes the exit
# code of the `if`.
run: 'if [ -d /py-venv/ROOT-CI/bin/ ]; then . /py-venv/ROOT-CI/bin/activate && echo PATH=$PATH >> $GITHUB_ENV; fi'

# TODO: install latest versions in image on root-ci-images
- name: Install Doxygen 1.10.0
run : |
mkdir -p ${{ github.workspace }}/doxygen
curl -L https://github.com/doxygen/doxygen/releases/download/Release_1_10_0/doxygen-1.10.0.linux.bin.tar.gz | tar -xz -C ${{ github.workspace }}/doxygen/ --strip-components=1
echo PATH=$PATH:${{ github.workspace }}/doxygen/bin >> $GITHUB_ENV
- name: Install qhelpgenerator
run : |
dnf update -y && dnf install -y sudo
sudo dnf update -y
sudo dnf upgrade -y
sudo dnf install -y qt5-qhelpgenerator

- name: Apply option overrides
if: ${{ github.event_name != 'schedule' }}
env:
OVERRIDES: "testing=off roottest=off minimal=on" # can be removed if this workflow is merged with root-ci.yml
CONFIGFILE: '.github/workflows/root-ci-config/buildconfig/alma9.txt'
shell: bash
run: |
set -x
echo '' >> "$CONFIGFILE"
for ENTRY in $OVERRIDES; do
KEY=$( echo "$ENTRY" | cut -d '=' -f 1 )
# Add entry to file if not exists, otherwise replace
if grep -q "$KEY=" "$CONFIGFILE"; then
sed -i "s/$KEY=.*\$/$ENTRY/" "$CONFIGFILE"
else
echo "$ENTRY" >> "$CONFIGFILE"
fi
done
cat "$CONFIGFILE" || true

- name: Dump GitHub context
env:
GITHUB_CONTEXT: ${{ toJSON(github) }}
run: echo "$GITHUB_CONTEXT"


- name: Print debug info
run: 'printf "%s@%s\\n" "$(whoami)" "$(hostname)";
ls -la
'

- name: Pull Request Build
if: github.event_name == 'pull_request'
env:
INCREMENTAL: ${{ !contains(github.event.pull_request.labels.*.name, 'clean build') }}
GITHUB_PR_ORIGIN: ${{ github.event.pull_request.head.repo.clone_url }}
run: ".github/workflows/root-ci-config/build_root.py
--buildtype Release
--platform alma9
--image registry.cern.ch/root-ci/alma9:buildready
--dockeropts '--security-opt label=disable --rm'
--incremental $INCREMENTAL
--base_ref ${{ github.base_ref }}
--sha ${{ github.sha }}
--pull_repository ${{ github.event.pull_request.head.repo.clone_url }}
--head_ref refs/pull/${{ github.event.pull_request.number }}/head:${{ github.event.pull_request.head.ref }}
--head_sha ${{ github.event.pull_request.head.sha }}
--repository ${{ github.server_url }}/${{ github.repository }}
"

# - name: Nightly build
# if: github.event_name == 'schedule'
# run: ".github/workflows/root-ci-config/build_root.py
# --buildtype Release
# --platform alma9
# --incremental false
# --binaries false
# --base_ref ${{ inputs.ref_name }}
# --repository ${{ github.server_url }}/${{ github.repository }}
# "

- name: Workflow dispatch
if: github.event_name == 'workflow_dispatch'
run: ".github/workflows/root-ci-config/build_root.py
--buildtype Release
--platform alma9
--incremental ${{ inputs.incremental }}
--base_ref ${{ inputs.base_ref }}
--head_ref ${{ inputs.head_ref }}
--binaries ${{ inputs.binaries }}
--repository ${{ github.server_url }}/${{ github.repository }}
"

- name: Run Doxygen
shell: bash
run: |
source ${DOC_LOCATION}/ROOT-CI/build/bin/thisroot.sh
export DOXYGEN_OUTPUT_DIRECTORY=${DOC_LOCATION}/${DOC_DIR}_TMP

cd ${DOC_LOCATION}/ROOT-CI/src/documentation/doxygen
make -j$(nproc)
mv -f ${DOXYGEN_OUTPUT_DIRECTORY}/html ${DOC_LOCATION}/${DOC_DIR}
if [ -d ${DOXYGEN_OUTPUT_DIRECTORY}/notebooks ]; then
mv ${DOXYGEN_OUTPUT_DIRECTORY}/notebooks ${DOC_LOCATION}/${DOC_DIR}/notebooks
fi

# The output DOCU_LOCATION set in documentation/doxygen/CMakeLists.txt
- name: Create documentation archives
working-directory: ${{ env.DOC_LOCATION }}
shell: bash
run: |
tarnamegz=${DOC_DIR}.tar.gz
tar zcf $tarnamegz ${DOC_DIR}
tarnamexz1=${DOC_DIR}.tar
tar cf $tarnamexz1 ${DOC_DIR}
xz -T5 -f $tarnamexz1

# TODO: upload to website instead
- name: Upload tar.gz
if: ${{ !cancelled() }}
uses: actions/upload-artifact@v4
with:
name: ${DOC_LOCATION}/${DOC_DIR}.tar.gz
path: ${DOC_LOCATION}/${DOC_DIR}.tar.gz

- name: Upload tar.xz
if: ${{ !cancelled() }}
uses: actions/upload-artifact@v4
with:
name: ${DOC_LOCATION}/${DOC_DIR}.tar.xz
path: ${DOC_LOCATION}/${DOC_DIR}.tar.xz

3 changes: 1 addition & 2 deletions documentation/doxygen/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ define MkDir
+@[ -d $1 ] || mkdir -p $1
endef

all: filter folders mathjax js images doxygen replaceCollaborationDiagrams notebooks rootWork
all: filter folders mathjax js images doxygen replaceCollaborationDiagrams

filter:
`root-config --cxx` -o filter filter.cxx -std=c++14 -O2
Expand Down Expand Up @@ -63,7 +63,6 @@ doxygen: filter pyzdoc
./makehtmlfooter.sh > htmlfooter.html
./makeinput.sh
doxygen
bash ./CleanNamespaces.sh
rm -rf files c1* *.ps *.eps *.png *.jpg *.tex *.svg *.pdf *.root *.xpm *.out *.dat *.dtd *.dot *.txt *.csv *.log *.rs
rm -rf listofclass.sh tmva* data* result* config* test* Roo* My* Freq*
rm -f Doxyfile_INPUT filter htmlfooter.html MDF.C pca.C
Expand Down
92 changes: 46 additions & 46 deletions documentation/doxygen/makeinput.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,52 +25,52 @@ echo " ../../core/unix/ \\" >> Doxyfile_INPUT
echo " ../../core/winnt/ \\" >> Doxyfile_INPUT
echo " ../../core/imt/ \\" >> Doxyfile_INPUT
echo " ../../core/zip/inc/Compression.h \\" >> Doxyfile_INPUT
echo " ../../geom/ \\" >> Doxyfile_INPUT
echo " ../../graf2d/asimage/ \\" >> Doxyfile_INPUT
echo " ../../graf2d/cocoa/ \\" >> Doxyfile_INPUT
echo " ../../graf2d/fitsio/ \\" >> Doxyfile_INPUT
echo " ../../graf2d/gpad/ \\" >> Doxyfile_INPUT
echo " ../../graf2d/gpadv7/ \\" >> Doxyfile_INPUT
echo " ../../graf2d/graf/ \\" >> Doxyfile_INPUT
echo " ../../graf2d/gviz/ \\" >> Doxyfile_INPUT
echo " ../../graf2d/postscript/ \\" >> Doxyfile_INPUT
echo " ../../graf2d/quartz/ \\" >> Doxyfile_INPUT
echo " ../../graf2d/win32gdk/ \\" >> Doxyfile_INPUT
echo " ../../graf2d/x11/ \\" >> Doxyfile_INPUT
echo " ../../graf2d/x11ttf/ \\" >> Doxyfile_INPUT
echo " ../../graf3d/eve/ \\" >> Doxyfile_INPUT
echo " ../../graf3d/eve7/ \\" >> Doxyfile_INPUT
echo " ../../graf3d/g3d/ \\" >> Doxyfile_INPUT
echo " ../../graf3d/gl/ \\" >> Doxyfile_INPUT
echo " ../../graf3d/gviz3d/ \\" >> Doxyfile_INPUT
echo " ../../gui/ \\" >> Doxyfile_INPUT
echo " ../../hist/ \\" >> Doxyfile_INPUT
echo " ../../html/ \\" >> Doxyfile_INPUT
echo " ../../io/doc/TFile \\" >> Doxyfile_INPUT
echo " ../../io/dcache/ \\" >> Doxyfile_INPUT
echo " ../../io/io/ \\" >> Doxyfile_INPUT
echo " ../../io/sql/ \\" >> Doxyfile_INPUT
echo " ../../io/xml/ \\" >> Doxyfile_INPUT
echo " ../../io/xmlparser/ \\" >> Doxyfile_INPUT
echo " ../../main/src/hadd.cxx \\" >> Doxyfile_INPUT
echo " ../../math/ \\" >> Doxyfile_INPUT
echo " ../../montecarlo/ \\" >> Doxyfile_INPUT
echo " ../../net/doc/ \\" >> Doxyfile_INPUT
echo " ../../net/auth/ \\" >> Doxyfile_INPUT
echo " ../../net/davix/ \\" >> Doxyfile_INPUT
echo " ../../net/http/ \\" >> Doxyfile_INPUT
echo " ../../net/net/ \\" >> Doxyfile_INPUT
echo " ../../net/netxng/ \\" >> Doxyfile_INPUT
echo " ../../net/httpsniff/ \\" >> Doxyfile_INPUT
echo " ../../proof/ \\" >> Doxyfile_INPUT
echo " ../../tmva/ \\" >> Doxyfile_INPUT
echo " ../../roofit/ \\" >> Doxyfile_INPUT
echo " ../../tree/ \\" >> Doxyfile_INPUT
echo " ../../sql/ \\" >> Doxyfile_INPUT
echo " ../../tutorials/ \\" >> Doxyfile_INPUT
echo " ../../bindings/tpython/ \\" >> Doxyfile_INPUT
echo " ../../bindings/pyroot/ \\" >> Doxyfile_INPUT
echo " ../../bindings/r/ \\" >> Doxyfile_INPUT
# echo " ../../geom/ \\" >> Doxyfile_INPUT
# echo " ../../graf2d/asimage/ \\" >> Doxyfile_INPUT
# echo " ../../graf2d/cocoa/ \\" >> Doxyfile_INPUT
# echo " ../../graf2d/fitsio/ \\" >> Doxyfile_INPUT
# echo " ../../graf2d/gpad/ \\" >> Doxyfile_INPUT
# echo " ../../graf2d/gpadv7/ \\" >> Doxyfile_INPUT
# echo " ../../graf2d/graf/ \\" >> Doxyfile_INPUT
# echo " ../../graf2d/gviz/ \\" >> Doxyfile_INPUT
# echo " ../../graf2d/postscript/ \\" >> Doxyfile_INPUT
# echo " ../../graf2d/quartz/ \\" >> Doxyfile_INPUT
# echo " ../../graf2d/win32gdk/ \\" >> Doxyfile_INPUT
# echo " ../../graf2d/x11/ \\" >> Doxyfile_INPUT
# echo " ../../graf2d/x11ttf/ \\" >> Doxyfile_INPUT
# echo " ../../graf3d/eve/ \\" >> Doxyfile_INPUT
# echo " ../../graf3d/eve7/ \\" >> Doxyfile_INPUT
# echo " ../../graf3d/g3d/ \\" >> Doxyfile_INPUT
# echo " ../../graf3d/gl/ \\" >> Doxyfile_INPUT
# echo " ../../graf3d/gviz3d/ \\" >> Doxyfile_INPUT
# echo " ../../gui/ \\" >> Doxyfile_INPUT
# echo " ../../hist/ \\" >> Doxyfile_INPUT
# echo " ../../html/ \\" >> Doxyfile_INPUT
# echo " ../../io/doc/TFile \\" >> Doxyfile_INPUT
# echo " ../../io/dcache/ \\" >> Doxyfile_INPUT
# echo " ../../io/io/ \\" >> Doxyfile_INPUT
# echo " ../../io/sql/ \\" >> Doxyfile_INPUT
# echo " ../../io/xml/ \\" >> Doxyfile_INPUT
# echo " ../../io/xmlparser/ \\" >> Doxyfile_INPUT
# echo " ../../main/src/hadd.cxx \\" >> Doxyfile_INPUT
# echo " ../../math/ \\" >> Doxyfile_INPUT
# echo " ../../montecarlo/ \\" >> Doxyfile_INPUT
# echo " ../../net/doc/ \\" >> Doxyfile_INPUT
# echo " ../../net/auth/ \\" >> Doxyfile_INPUT
# echo " ../../net/davix/ \\" >> Doxyfile_INPUT
# echo " ../../net/http/ \\" >> Doxyfile_INPUT
# echo " ../../net/net/ \\" >> Doxyfile_INPUT
# echo " ../../net/netxng/ \\" >> Doxyfile_INPUT
# echo " ../../net/httpsniff/ \\" >> Doxyfile_INPUT
# echo " ../../proof/ \\" >> Doxyfile_INPUT
# echo " ../../tmva/ \\" >> Doxyfile_INPUT
# echo " ../../roofit/ \\" >> Doxyfile_INPUT
# echo " ../../tree/ \\" >> Doxyfile_INPUT
# echo " ../../sql/ \\" >> Doxyfile_INPUT
# echo " ../../tutorials/ \\" >> Doxyfile_INPUT
# echo " ../../bindings/tpython/ \\" >> Doxyfile_INPUT
# echo " ../../bindings/pyroot/ \\" >> Doxyfile_INPUT
# echo " ../../bindings/r/ \\" >> Doxyfile_INPUT

# echo " ../../core/clib/ \\" >> Doxyfile_INPUT
# echo " ../../core/lzma/ \\" >> Doxyfile_INPUT
Expand Down