-
Notifications
You must be signed in to change notification settings - Fork 1
/
action.yml
48 lines (48 loc) · 1.81 KB
/
action.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
name: 'ROOT CERN CI'
description: 'Run ROOT CERN scripts'
inputs:
scripts:
description: 'The ROOT CERN scripts to run, separated by commas'
required: true
output_files:
description: 'The output files to check for, separated by commas'
required: false
runs:
using: 'composite'
steps:
- run: wget https://github.com/MohamedElashri/ROOT/releases/download/ubuntu/root_v6.28.04_Ubuntu_20.04.zip
shell: bash
- run: |
sudo unzip root_v6.28.04_Ubuntu_20.04.zip -d /usr/local
sudo mv /usr/local/root_build /usr/local/root
shell: bash
- run: |
sudo apt-get install git dpkg-dev cmake g++ gcc binutils libx11-dev libxpm-dev libxft-dev libxext-dev tar gfortran subversion
shell: bash
- id: run-scripts
run: |
export PATH=$PATH:/usr/local/root/bin
IFS=',' read -ra SCRIPTS <<< "${{ inputs.scripts }}"
IFS=',' read -ra OUTPUT_FILES <<< "${{ inputs.output_files }}"
for i in "${!SCRIPTS[@]}"; do
root -b -q -l ${SCRIPTS[$i]}
if [ $? -eq 0 ]; then
echo "ROOT script ${SCRIPTS[$i]} executed successfully."
else
echo "Error: ROOT script ${SCRIPTS[$i]} failed to execute."
exit 1
fi
if [ ! -z "${OUTPUT_FILES[$i]}" ]; then
if [ -f ${OUTPUT_FILES[$i]} ]; then
echo "ROOT script ${SCRIPTS[$i]} generated the output file ${OUTPUT_FILES[$i]} successfully."
else
echo "Warning: ROOT script ${SCRIPTS[$i]} did not generate the output file ${OUTPUT_FILES[$i]}."
fi
fi
done
shell: bash
env:
ROOTSYS: /usr/local/root
CMAKE_PREFIX_PATH: /usr/local/root
LD_LIBRARY_PATH: /usr/local/root/lib
GITHUB_PATH: ${{ env.GITHUB_PATH }}:/usr/local/root/bin