-
Notifications
You must be signed in to change notification settings - Fork 2
90 lines (81 loc) · 2.82 KB
/
ci-buildmatrix-cpp11.yml
File metadata and controls
90 lines (81 loc) · 2.82 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
---
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: Build inside ROOT CentOS7 container
env:
VBF_TOKEN: ${{ secrets.VBFcpp11 }}
SOFA20231011: ${{ secrets.SOFA20231011 }}
run: |
set -euo pipefail
echo "Using ROOT image: $ROOT_IMAGE"
docker run --rm \
-e VBF_TOKEN="$VBF_TOKEN" \
-e SOFA20231011="$SOFA20231011" \
-v "$PWD:/workspace" \
-w /workspace \
"$ROOT_IMAGE" /bin/bash -c '
set -euo pipefail
echo "ROOT version: $(root-config --version)"
# Build VBF
curl -L "https://syncandshare.desy.de/index.php/s/${VBF_TOKEN}/download" -o VBF.tar.gz
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
mkdir -p sofa
curl -L "https://syncandshare.desy.de/index.php/s/${SOFA20231011}/download" -o sofa/sofa.tar.gz
./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