v492-15 #387
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| --- | |
| name: cpp11-buildmatrix | |
| # Controls when the workflow will run | |
| on: | |
| pull_request: | |
| workflow_dispatch: | |
| jobs: | |
| # Job 1: run on Ubuntu host (no container) to execute Node20-based actions safely | |
| source: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout source | |
| uses: actions/checkout@v6 | |
| - name: Create source tarball | |
| run: | | |
| set -euo pipefail | |
| # Use git archive to avoid including .git directory and prevent 'file changed as we read it' warnings | |
| git archive --format=tar HEAD | gzip > src.tgz | |
| - name: Upload source artifact | |
| # v4 okay here (runs on ubuntu host with modern glibc) | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: src | |
| path: src.tgz | |
| # Job 2: build inside CentOS7 ROOT container avoiding Node20 (use only Node16-compatible actions) | |
| build: | |
| needs: source | |
| runs-on: ubuntu-latest | |
| env: | |
| ROOT_IMAGE: rootproject/root:6.24.06-centos7 | |
| steps: | |
| - name: Download source artifact | |
| uses: actions/download-artifact@v8 | |
| with: | |
| name: src | |
| - name: Extract source | |
| run: tar -xzf src.tgz | |
| - name: Download VBF and SOFA on host | |
| env: | |
| VBF_TOKEN: ${{ secrets.VBFcpp11 }} | |
| SOFA20231011: ${{ secrets.SOFA20231011 }} | |
| run: | | |
| set -euo pipefail | |
| curl -fL --retry 3 --retry-delay 3 "https://syncandshare.desy.de/index.php/s/${VBF_TOKEN}/download" -o VBF.tar.gz | |
| mkdir -p sofa | |
| curl -fL --retry 3 --retry-delay 3 "https://syncandshare.desy.de/index.php/s/${SOFA20231011}/download" -o sofa/sofa.tar.gz | |
| - name: Build inside ROOT CentOS7 container | |
| run: | | |
| set -euo pipefail | |
| echo "Using ROOT image: $ROOT_IMAGE" | |
| docker run --rm \ | |
| -v "$PWD:/workspace" \ | |
| -w /workspace \ | |
| "$ROOT_IMAGE" /bin/bash -c ' | |
| set -euo pipefail | |
| echo "ROOT version: $(root-config --version)" | |
| # Build VBF | |
| mkdir -p VBF && tar -xzf VBF.tar.gz -C VBF --strip-components=1 | |
| pushd VBF | |
| ./configure --prefix=/workspace/VBF | |
| make -j4 | |
| make install | |
| popd | |
| # Install SOFA | |
| ./install_sofa.sh | |
| # Build EventDisplay | |
| export EVNDISPSYS=/workspace | |
| export VBFSYS=/workspace/VBF | |
| export SOFASYS=/sofa | |
| export LD_LIBRARY_PATH=$EVNDISPSYS/obj:$EVNDISPSYS/lib:$VBFSYS/lib:${LD_LIBRARY_PATH:-} | |
| make -j4 VTS | |
| ' | |
| - name: Archive build outputs | |
| if: always() | |
| run: | | |
| tar -czf build-artifacts.tgz VBF obj lib || true | |
| - name: Upload build artifacts | |
| if: always() | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: build-artifacts | |
| path: build-artifacts.tgz |