Skip to content

Commit ae34d94

Browse files
committed
temporary: test gh action
1 parent ee6cd0a commit ae34d94

File tree

5 files changed

+285
-12
lines changed

5 files changed

+285
-12
lines changed

.github/workflows/root-ci-config/build_root.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,9 @@ def main():
8080

8181
options = build_utils.cmake_options_from_dict(options_dict)
8282

83+
if args.documentation:
84+
options = "-Ddocu=ON " + options
85+
8386
if WINDOWS:
8487
options = "-Thost=x64 " + options
8588

@@ -195,6 +198,7 @@ def parse_args():
195198
parser.add_argument("--head_ref", default=None, help="Ref to feature branch; it may contain a :<dst> part")
196199
parser.add_argument("--head_sha", default=None, help="Sha of commit that triggered the event")
197200
parser.add_argument("--binaries", default="false", help="Whether to create binary artifacts")
201+
parser.add_argument("--documentation", default="false", help="Whether to generate Doxygen documentation")
198202
parser.add_argument("--architecture", default=None, help="Windows only, target arch")
199203
parser.add_argument("--repository", default="https://github.com/root-project/root.git",
200204
help="url to repository")
@@ -205,6 +209,7 @@ def parse_args():
205209
args.incremental = args.incremental.lower() in ('yes', 'true', '1', 'on')
206210
args.coverage = args.coverage.lower() in ('yes', 'true', '1', 'on')
207211
args.binaries = args.binaries.lower() in ('yes', 'true', '1', 'on')
212+
args.documentation = args.documentation.lower() in ('yes', 'true', '1', 'on')
208213

209214
if not args.base_ref:
210215
die(os.EX_USAGE, "base_ref not specified")
@@ -564,6 +569,5 @@ def create_coverage_xml() -> None:
564569
if result != 0:
565570
die(result, "Failed to create test coverage")
566571

567-
568572
if __name__ == "__main__":
569573
main()
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
clad=off
2+
tmva=off
3+
webgui=off
4+
dataframe=off
5+
fail-on-missing=off
6+
roofit=off
7+
pyroot=off
8+
roofit_multiprocess=off
9+
opengl=off
10+
root7=off
11+
davix=off
12+
fitsio=off
13+

.github/workflows/root-docs.yml

Lines changed: 252 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,252 @@
1+
2+
name: 'Generate Doxygen Documentation'
3+
4+
on:
5+
# TODO: incremental on pull request
6+
push:
7+
8+
workflow_dispatch:
9+
inputs:
10+
head_ref:
11+
description: rebase from ...
12+
type: string
13+
required: true
14+
default: master
15+
base_ref:
16+
description: ... to ... (can have same value)
17+
type: string
18+
required: true
19+
default: master
20+
incremental:
21+
description: 'Do incremental build'
22+
type: boolean
23+
required: true
24+
default: true
25+
binaries:
26+
description: Create binary packages and upload them as artifacts
27+
type: boolean
28+
required: true
29+
default: false
30+
overrides:
31+
type: string
32+
default: "DOCU_INPUT=\"./mainpage.md;../../core;../../tutorials;\""
33+
# DOXYGEN_EXECUTABLE=/home/runner/work/root/root/doxygen/install/bin/doxygen"
34+
required: true
35+
# platform:
36+
# type: string
37+
# default: alma9
38+
# required: true
39+
40+
jobs:
41+
gen-docs:
42+
runs-on:
43+
- self-hosted
44+
- linux
45+
- x64
46+
47+
container:
48+
image: registry.cern.ch/root-ci/alma9:buildready # ALSO UPDATE BELOW!
49+
options: '--security-opt label=disable --rm' # ALSO UPDATE BELOW!
50+
env:
51+
OS_APPLICATION_CREDENTIAL_ID: '7f5b64a265244623a3a933308569bdba'
52+
OS_APPLICATION_CREDENTIAL_SECRET: ${{ secrets.OS_APPLICATION_CREDENTIAL_SECRET }}
53+
OS_AUTH_TYPE: 'v3applicationcredential'
54+
OS_AUTH_URL: 'https://keystone.cern.ch/v3'
55+
OS_IDENTITY_API_VERSION: 3
56+
OS_INTERFACE: 'public'
57+
OS_REGION_NAME: 'cern'
58+
PYTHONUNBUFFERED: true
59+
60+
steps:
61+
- name: Checkout
62+
uses: actions/checkout@v4
63+
with:
64+
fetch-depth: 0
65+
66+
# - name: Set up Python
67+
# uses: actions/setup-python@master
68+
# with:
69+
# python-version: "3.10-dev"
70+
# architecture: x64
71+
# platform: linux
72+
# cache: 'pip' # caching pip dependencies
73+
# run: |
74+
# python3 -m pip install --upgrade pip setuptools
75+
# python3 -m pip install python-openstackclient
76+
77+
# - name: Install required packages
78+
# run: |
79+
# apt update -y && apt install -y sudo
80+
# sudo apt update -y
81+
# sudo apt upgrade -y
82+
# sudo apt-get install -y terminfo gfortran libpostgresql-ocaml-dev libtbb-dev libgl2ps-dev lzma-dev libgsl0-dev \
83+
# libldap2-dev graphviz-dev libmysqlclient-dev python3.10-dev libxrootd-dev \
84+
# libxrootd-client-dev xrootd-client libopengl-dev qhelpgenerator-qt5 xlibmesa-glu-dev
85+
86+
# - uses: tecolicom/actions-use-apt-tools@main
87+
# with:
88+
# tools: curl wget git ninja-build gcc g++ make binutils cmake dpkg-dev
89+
# libssl-dev git libx11-dev libxext-dev libxft-dev libxpm-dev
90+
# libpcre3-dev libglew-dev libftgl-dev
91+
# libfftw3-dev libcfitsio-dev libavahi-compat-libdnssd-dev
92+
# python3-dev python3-numpy libxml2-dev libkrb5-dev
93+
# qtwebengine5-dev nlohmann-json3-dev
94+
# liblzma-dev xxhash libxxhash-dev libzstd-dev zstd liblz4-dev lz4
95+
# davix-dev libfreetype6-dev
96+
# libprotobuf-dev protobuf-compiler protobuf-c-compiler libblas-dev java-common
97+
# libsqlite3-dev libgif-dev libtiff-dev libjpeg-dev
98+
# libedit-dev googletest-tools graphviz
99+
# run: |
100+
# apt update -y && apt install -y sudo
101+
# sudo apt update -y
102+
# sudo apt upgrade -y
103+
# sudo apt-get install -y curl wget python3
104+
# sudo apt-get install -y git ninja-build gcc g++ make binutils cmake dpkg-dev
105+
# libssl-dev git libx11-dev libxext-dev libxft-dev libxpm-dev \
106+
# gfortran libpcre3-dev xlibmesa-glu-dev libglew-dev libftgl-dev \
107+
# libmysqlclient-dev libfftw3-dev libcfitsio-dev \
108+
# graphviz-dev libavahi-compat-libdnssd-dev \
109+
# libldap2-dev python3-dev python3-numpy libxml2-dev libkrb5-dev \
110+
# libgsl0-dev qtwebengine5-dev nlohmann-json3-dev \
111+
# lzma-dev liblzma-dev xxhash libxxhash-dev libzstd-dev zstd liblz4-dev lz4 \
112+
# libgl2ps-dev davix-dev libfreetype6-dev libxrootd-dev libxrootd-client-dev xrootd-client \
113+
# libtbb-dev libprotobuf-dev protobuf-compiler protobuf-c-compiler libblas-dev java-common \
114+
# libpostgrcesql-ocaml-dev libsqlite3-dev libgif-dev libtiff-dev libjpeg-dev libopengl-dev \
115+
# terminfo libedit-dev googletest-tools
116+
# sudo apt-get install -y graphviz qhelpgenerator-qt5
117+
118+
- name: Set up Python Virtual Env
119+
# if the `if` expr is false, `if` still has exit code 0.
120+
# if the `if` block is entered, the block's exit code becomes the exit
121+
# code of the `if`.
122+
run: 'if [ -d /py-venv/ROOT-CI/bin/ ]; then . /py-venv/ROOT-CI/bin/activate && echo PATH=$PATH >> $GITHUB_ENV; fi'
123+
124+
# - name: Install Python modules (for local testing only?)
125+
# run: |
126+
# sudo apt-get install python3-pip -y
127+
# python3 -m pip install --upgrade pip setuptools
128+
# python3 -m pip install python-openstackclient pytest pyspark distributed
129+
130+
# - name: Setup cmake
131+
# uses: jwlawson/actions-setup-cmake@v1.14
132+
# with:
133+
# cmake-version: '3.29.x'
134+
135+
# - name: cache doxygen for faster debugging
136+
# uses: actions/cache@v4
137+
# id: cache-doxygen
138+
# with:
139+
# path: ${{ github.workspace }}/doxygen
140+
# key: ${{ runner.os }}-doxygen
141+
142+
- name: Build Doxygen
143+
if: steps.cache-doxygen.outputs.cache-hit != 'true'
144+
run: |
145+
git clone https://github.com/doxygen/doxygen.git --depth 1
146+
cd doxygen
147+
mkdir build && cd build
148+
cmake ../ -G Ninja -DCMAKE_INSTALL_PREFIX=../install
149+
ninja
150+
ninja install
151+
# echo ${{ github.workspace }}/doxygen/install/bin >> $GITHUB_PATH
152+
# echo $(cd ../install/lib; pwd) >> $GITHUB_PATH
153+
# export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:$(cd install/bin; pwd)
154+
155+
- name: Apply option overrides
156+
if: ${{ github.event_name != 'schedule' }}
157+
env:
158+
OVERRIDES: "DOXYGEN_EXECUTABLE=${{ github.workspace }}/doxygen/install/bin/doxygen
159+
${{ inputs.overrides }}"
160+
# DOXYGEN_GENERATE_QHP=on DOCU_QHG_LOCATION=qhelpgenerator"
161+
CONFIGFILE: '.github/workflows/root-ci-config/buildconfig/minimal.txt'
162+
shell: bash
163+
run: |
164+
set -x
165+
166+
echo '' >> "$CONFIGFILE"
167+
for ENTRY in $OVERRIDES; do
168+
KEY=$( echo "$ENTRY" | cut -d '=' -f 1 )
169+
170+
# Add entry to file if not exists, otherwise replace
171+
172+
if grep -q "$KEY=" "$CONFIGFILE"; then
173+
sed -i "s/$KEY=.*\$/$ENTRY/" "$CONFIGFILE"
174+
else
175+
echo "$ENTRY" >> "$CONFIGFILE"
176+
fi
177+
done
178+
179+
cat "$CONFIGFILE" || true
180+
181+
- name: Dump GitHub context
182+
env:
183+
GITHUB_CONTEXT: ${{ toJSON(github) }}
184+
run: echo "$GITHUB_CONTEXT"
185+
186+
- name: Print debug info
187+
run: |
188+
printf "%s@%s\\n" "$(whoami)" "$(hostname)"
189+
ls -la
190+
ls /usr/bin/
191+
env
192+
193+
# - name: cache root for faster debugging
194+
# uses: actions/cache@v4
195+
# id: cache-root
196+
# with:
197+
# path: |
198+
# ${{ github.workspace }}/ROOT-CI/build/interpreter
199+
# ${{ github.workspace }}/ROOT-CI/build/include
200+
# key: ${{ runner.os }}-root-1
201+
202+
- name: Build ROOT with documentation
203+
if: github.event_name == 'push'
204+
run: ".github/workflows/root-ci-config/build_root.py
205+
--buildtype Release
206+
--platform minimal
207+
--incremental true
208+
--base_ref ${{ github.ref_name }}
209+
--binaries false
210+
--documentation false
211+
--repository ${{ github.server_url }}/${{ github.repository }}
212+
"
213+
214+
- name: Build ROOT with documentation
215+
if: github.event_name == 'workflow_dispatch'
216+
run: ".github/workflows/root-ci-config/build_root.py
217+
--buildtype Release
218+
--platform minimal
219+
--incremental true
220+
--base_ref ${{ inputs.base_ref }}
221+
--head_ref ${{ inputs.head_ref }}
222+
--binaries false
223+
--documentation false
224+
--repository ${{ github.server_url }}/${{ github.repository }}
225+
"
226+
227+
# # For faster testing
228+
# - name: Restore cached ROOT
229+
# id: cache-deps-restore
230+
# uses: actions/cache/restore@v3
231+
# with:
232+
# path: ~/root
233+
# key: ${{ runner.os }}-deps
234+
235+
# - name: Check out ROOT
236+
# uses: actions/checkout@v4
237+
# with:
238+
# repository: jolly-chen/root
239+
# ref: 'gen_docs_ci'
240+
# token: ${{ secrets.GITHUB_TOKEN }}
241+
# path: root
242+
243+
# - name: Save deps
244+
# id: cache-deps-save
245+
# uses: actions/cache/save@v3
246+
# with:
247+
# path: ~/root
248+
# key: ${{ steps.cache-deps-restore.outputs.cache-primary-key }}
249+
250+
# - name: ls
251+
# run: |
252+
# ls

documentation/doxygen/CMakeLists.txt

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
project(ROOT_documentation)
22

3-
#set(CMAKE_VERBOSE_MAKEFILE ON) # set to ON for debugging; or rather use --verbose when calling cmake
3+
# set(CMAKE_VERBOSE_MAKEFILE ON) # set to ON for debugging; or rather use --verbose when calling cmake
44
cmake_minimum_required(VERSION 3.10)
55
if(CMAKE_VERSION VERSION_LESS 3.21)
66
get_directory_property(hasParent PARENT_DIRECTORY)
@@ -17,6 +17,14 @@ else()
1717
endif()
1818
endif()
1919

20+
if(DEFINED ROOTSYS)
21+
set (ROOT_DIR ${ROOTSYS} CACHE STRING "ROOT build directory")
22+
else()
23+
set (ROOT_DIR /opt/root/ CACHE STRING "ROOT build directory")
24+
endif()
25+
set (PYTHONPATH ${ROOT_DIR}/lib CACHE STRING "PYTHONPATH")
26+
find_package(ROOT 6.32 CONFIG REQUIRED)
27+
2028
if(builtin_docu)
2129
message(STATUS "ROOT HTML documentation will be built with doxygen as a step of the ROOT build.")
2230
# TODO: https://stackoverflow.com/questions/16408060/how-do-i-add-a-dependency-on-a-script-to-a-target-in-cmake
@@ -26,14 +34,6 @@ else()
2634
# cd /tmp/ && mkdir builddocu && cd builddocu cmake -B./ -S/opt/root_src/documentation/doxygen/ -DDOCU_INPUT="./mainpage.md;../../core" -DDOCU_LOCATION=/tmp/docoutput -DDOCU_THREADS=8 -DDOCU_LOGFILE=/tmp/warnings.txt -DDOXYGEN_EXECUTABLE=/opt/doxygen/build/bin/doxygen -DDOCU_QHG_LOCATION=/opt/Qt/5.15.2/gcc_64/bin/qhelpgenerator
2735
endif()
2836

29-
if(DEFINED ROOTSYS)
30-
set (ROOT_DIR ${ROOTSYS} CACHE STRING "ROOT build directory")
31-
else()
32-
set (ROOT_DIR /opt/root/ CACHE STRING "ROOT build directory")
33-
endif()
34-
set (PYTHONPATH ${ROOT_DIR}/lib CACHE STRING "PYTHONPATH")
35-
find_package(ROOT 6.32 CONFIG REQUIRED)
36-
3737
# Consider building Doxygen >1.9.3 and with Clang enabled (download as precompiled binary from GitHub):
3838
# cmake ../ -DCMAKE_PREFIX_PATH=/opt/clang+llvm-16.0.4-x86_64-linux-gnu-ubuntu-22.04/lib/cmake/llvm/ -Duse_libclang=ON -Dstatic_libclang=ON -DCMAKE_INSTALL_PREFIX=../install
3939
set(DOXYGEN_EXECUTABLE ${DOXYGEN_EXECUTABLE} CACHE STRING "Path to custom doxygen executable") # Use e.g. -DDOXYGEN_EXECUTABLE=/opt/doxygen/build/bin/doxygen for a local built doxygen. Leave empty for system-wide doxygen.
@@ -44,8 +44,8 @@ find_package(Python3 COMPONENTS Interpreter)
4444

4545
execute_process(COMMAND ${ROOT_root_CMD}-config --cxx OUTPUT_VARIABLE ROOT_CXX_COMPILER OUTPUT_STRIP_TRAILING_WHITESPACE)
4646
execute_process(COMMAND ${ROOT_root_CMD} -l -b -q -e gROOT->GetGitBranch\(\) OUTPUT_VARIABLE ROOT_GIT_VERSION OUTPUT_STRIP_TRAILING_WHITESPACE)
47-
STRING(REGEX REPLACE "^\n\\(const char \\*\\) " "" ROOT_GIT_VERSION ${ROOT_GIT_VERSION})
48-
#message(${ROOT_GIT_VERSION})
47+
# STRING(REGEX REPLACE "^\n\\(const char \\*\\) " "" ROOT_GIT_VERSION ${ROOT_GIT_VERSION})
48+
4949
execute_process(COMMAND find ../../ -type d -name dictpch -prune -o -type d -name inc OUTPUT_VARIABLE ROOT_INC_FOLDERS OUTPUT_STRIP_TRAILING_WHITESPACE WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
5050
string(REPLACE "\n" ";" ROOT_INC_FOLDERS ${ROOT_INC_FOLDERS})
5151
list(APPEND ROOT_INC_FOLDERS ../../interpreter/llvm/src/tools/clang/include)#different pattern

tutorials/CMakeLists.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ project(tutorials)
1414
# but variables like ROOT_asimage_FOUND used here and produced in ROOTConfig.cmake
1515
find_package(ROOT REQUIRED)
1616

17+
message(STATUS "ROOT_SOURCE_DIR = ${ROOT_SOURCE_DIR}")
1718
if(DEFINED ROOT_SOURCE_DIR) # Testing using the binary tree
1819
set(ROOT_root_CMD root.exe)
1920
if(NOT MSVC) # Ignore environment on Windows
@@ -25,15 +26,18 @@ if(DEFINED ROOT_SOURCE_DIR) # Testing using the binary tree
2526
set(ROOT_environ ROOTSYS=${CMAKE_BINARY_DIR}
2627
PYTHONPATH=${CMAKE_BINARY_DIR}/bin;$ENV{PYTHONPATH})
2728
endif()
29+
message(STATUS "ROOT_environ = ${ROOT_environ}")
2830
else() # testing using an installation
2931
include(${ROOT_USE_FILE})
32+
message(STATUS "ROOT_CONFIG_EXECUTABLE = ${ROOT_CONFIG_EXECUTABLE}")
3033
if(DEFINED ROOT_CONFIG_EXECUTABLE) #---If ROOT was built with the classic configure/make---
3134
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_CURRENT_SOURCE_DIR}/../cmake/modules)
3235
include(RootMacros)
3336
set(ROOT_root_CMD root.exe)
3437
endif()
3538
enable_testing()
3639
endif()
40+
message(STATUS "ROOT_root_CMD = ${ROOT_root_CMD}")
3741

3842
#---Copy the CTestCustom.cmake file into the build directory--------
3943
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/CTestCustom.cmake ${CMAKE_CURRENT_BINARY_DIR} COPYONLY)

0 commit comments

Comments
 (0)