-
Notifications
You must be signed in to change notification settings - Fork 6
/
.gitlab-ci.yml
177 lines (162 loc) · 5.94 KB
/
.gitlab-ci.yml
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
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
image: ghcr.io/lobis/root-geant4-garfield:rest-for-physics
stages:
- Build
- Build Standalone
- Load REST Libraries
- Run Examples
before_script:
- export USER="rest"
- pwd
- if [ -f "/opt/root/install/bin/thisroot.sh" ]; then source /opt/root/install/bin/thisroot.sh; fi
- root-config --version
- if [ -f "/opt/geant4/install/bin/geant4.sh" ]; then source /opt/geant4/install/bin/geant4.sh; fi
- geant4-config --version
- python3 --version
- apt update && apt install -y wget
# This is the one we use to run validations tests. We save the installation as an artifact.
Build and Install:
stage: Build
script:
- echo "**${CI_PROJECT_DIR}**"
- git clone https://github.com/rest-for-physics/framework.git framework
- cd framework
- ./scripts/checkoutRemoteBranch.sh ${CI_COMMIT_BRANCH}
- rm -rf ${CI_PROJECT_DIR}/install
- git submodule init source/libraries/geant4
- git submodule update source/libraries/geant4
- cd source/libraries/geant4/
# We attempt to pull a branch from geant4lib named as the one at restG4.
# If not it will pull master by default
- ../../../scripts/checkoutRemoteBranch.sh ${CI_COMMIT_BRANCH}
- cd ../../../
- git submodule init source/packages/restG4
- git submodule update source/packages/restG4
- cd source/packages/restG4/
- git checkout ${CI_COMMIT_BRANCH}
- cd ../../../
- rm -rf build
- mkdir build
- cd build
- cmake ../ -DREST_WELCOME=ON -DREST_G4=ON -DCMAKE_INSTALL_PREFIX=${CI_PROJECT_DIR}/install
- make -j2 install
artifacts:
paths:
- ${CI_PROJECT_DIR}/install
- ${CI_PROJECT_DIR}/framework
- ${CI_PROJECT_DIR}/framework/build
expire_in: 1 day
Build Standalone:
stage: Build Standalone
script:
- echo "**${CI_PROJECT_DIR}**"
- cd ${CI_PROJECT_DIR}/
- rm -rf build
- mkdir build
- cd build
- source ${CI_PROJECT_DIR}/install/thisREST.sh
- cmake ../ -DCMAKE_INSTALL_PREFIX=${CI_PROJECT_DIR}/install-standalone
- make -j2 install
- ${CI_PROJECT_DIR}/install-standalone/bin/restG4 --help
- rm -rf ${CI_PROJECT_DIR}/install-standalone
Load REST Libraries:
stage: Load REST Libraries
script:
- source ${CI_PROJECT_DIR}/install/thisREST.sh
- restRoot -b -q
01.NLDBD:
stage: Run Examples
script:
- source ${CI_PROJECT_DIR}/install/thisREST.sh
- cd ${CI_PROJECT_DIR}/install/examples/restG4/01.NLDBD/
- restG4 NLDBD.rml
- geant4-config --version
- restRoot -b -q Validate.C'("Run00001_NLDBD_Test.root")'
03.Fluorescence:
stage: Run Examples
script:
- source ${CI_PROJECT_DIR}/install/thisREST.sh
- cd ${CI_PROJECT_DIR}/install/examples/restG4/03.Fluorescence/
- restG4 gamma.rml
- restManager --c g4Analysis.rml --f Run00111_Gamma_Fluorescence.root
- geant4-config --version
- restRoot -b -q Validate.C'("Run00111_g4Analysis_Gamma_rest.root")'
04.MuonScan:
stage: Run Examples
script:
- source ${CI_PROJECT_DIR}/install/thisREST.sh
- cd ${CI_PROJECT_DIR}/install/examples/restG4/04.MuonScan/
- geant4-config --version
- restG4 MuonsFromPoint.rml -o MuonsFromPoint.root
- restRoot -b -q ValidateMuonsFromPoint.C'("MuonsFromPoint.root")'
- restG4 CosmicMuonsFromWall.rml -o CosmicMuonsFromWall.root
- restRoot -b -q ValidateCosmicMuonsFromWall.C'("CosmicMuonsFromWall.root")'
- restG4 CosmicMuonsFromCircle.rml -o CosmicMuonsFromCircle.root
- restRoot -b -q ValidateCosmicMuonsFromCircle.C'("CosmicMuonsFromCircle.root")'
05.PandaXIII:
stage: Run Examples
script:
- source ${CI_PROJECT_DIR}/install/thisREST.sh
- cd ${CI_PROJECT_DIR}/install/examples/restG4/05.PandaXIII/
- restG4 Xe136bb0n.rml
- restRoot -b -q Validate.C'("Xe136bb0n_n2E06.root")'
06.IonRecoils:
stage: Run Examples
script:
- source ${CI_PROJECT_DIR}/install/thisREST.sh
- cd ${CI_PROJECT_DIR}/install/examples/restG4/06.IonRecoils/
- restG4 recoils.rml
- restRoot -b -q Validate.C'("Run00001_F20_Recoils.root")'
07.FullChainDecay:
stage: Run Examples
script:
- source ${CI_PROJECT_DIR}/install/thisREST.sh
- cd ${CI_PROJECT_DIR}/install/examples/restG4/07.FullChainDecay/
- restG4 fullChain.rml
- restG4 singleDecay.rml
- restRoot -b -q Validate.C'("Run00001_U238_FullChainDecay.root", 16)'
- restRoot -b -q Validate.C'("Run00002_U238_SingleChainDecay.root", 1)'
- export REST_ISOTOPE="Be7"
- restG4 singleDecay.rml
- restRoot -b -q Validate.C'("Run00002_Be7_SingleChainDecay.root", 1)'
08.Alphas:
stage: Run Examples
script:
- source ${CI_PROJECT_DIR}/install/thisREST.sh
- cd ${CI_PROJECT_DIR}/install/examples/restG4/08.Alphas/
- mkdir data
- export REST_ENERGY=5
- export REST_FOIL=1
- restG4 alphas.rml
- export REST_ENERGY=5
- export REST_FOIL=5
- restG4 alphas.rml
- export REST_ENERGY=1
- export REST_FOIL=5
- restG4 alphas.rml
- restManager --c analysis.rml --f data/Run_1MeV_5um.root
- restManager --c analysis.rml --f data/Run_5MeV_1um.root
- restManager --c analysis.rml --f data/Run_5MeV_5um.root
- restManager --c plots.rml --f "data/*g4Ana*root" --batch
- restRoot -b -q Validate.C
09.Pb210_Shielding:
stage: Run Examples
script:
- source ${CI_PROJECT_DIR}/install/thisREST.sh
- cd ${CI_PROJECT_DIR}/install/examples/restG4/09.Pb210_Shield/
- restG4 Pb210.rml
- restRoot -b -q Validate.C'("Run00001_Pb210_Shielding.root")'
10.Geometries:
stage: Run Examples
script:
- source ${CI_PROJECT_DIR}/install/thisREST.sh
- cd ${CI_PROJECT_DIR}/install/examples/restG4/10.Geometries/
- restG4 Assembly.rml
- restRoot -b -q Validate.C'("Run00001_Assembly_Assembly.root")'
11.Xrays:
stage: Run Examples
script:
- source ${CI_PROJECT_DIR}/install/thisREST.sh
- cd ${CI_PROJECT_DIR}/install/examples/restG4/11.Xrays/
- restG4 xrays.rml
- restManager --c analysis.rml --f RestG4_xrays_00001_ArgonISO.root
- restRoot -b -q GetQE.C'("Run_g4Analysis_00001_xrays.root")'