|
| 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 |
0 commit comments