Skip to content

Commit 9333c69

Browse files
committed
add github actions config
1 parent 744f378 commit 9333c69

18 files changed

+125
-46
lines changed

.github/scripts/cred-helper.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
#!/bin/sh
2+
exec echo "$GITLAB_PASSWORD"

.github/scripts/gitlabmirror.sh

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
#!/bin/bash
2+
3+
#set -u
4+
5+
DEFAULT_POLL_TIMEOUT=10
6+
POLL_TIMEOUT=${POLL_TIMEOUT:-$DEFAULT_POLL_TIMEOUT}
7+
8+
echo ${GITHUB_REF}
9+
# leave ancient history undisturbed
10+
git fetch --shallow-since=01/01/2020
11+
12+
#github_ref
13+
#git checkout "${GITHUB_REF}"
14+
15+
#branch=${GITHUB_REPOSITORY}/$(git symbolic-ref --short HEAD)
16+
shortbranch=$(git symbolic-ref --short HEAD)
17+
18+
#git config --global credential.username $GITLAB_USERNAME
19+
#git config --global core.askPass .github/scripts/cred-helper.sh
20+
#git config --global credential.helper cache
21+
#git remote add mirror $GITLAB_URL
22+
#echo pushing to $shortbranch branch at $(git remote get-url --push mirror)
23+
#git push mirror $shortbranch
24+
25+
26+
# need a token with api acces
27+
curl --silent --header "PRIVATE-TOKEN: ${GITLAB_PASSWORD2}" -X https://${GITLAB_HOSTNAME}/api/v4/projects/${GITLAB_PROJECT_ID}/mirror/pull
28+
29+
sleep $POLL_TIMEOUT
30+
31+
32+
pipeline_id=$(curl --silent "https://${GITLAB_HOSTNAME}/api/v4/projects/${GITLAB_PROJECT_ID}/repository/commits/${shortbranch}" | jq '.last_pipeline.id')
33+
34+
echo "Triggered CI for branch ${shortbranch}"
35+
echo "Working with pipeline id #${pipeline_id}"
36+
echo "Poll timeout set to ${POLL_TIMEOUT}"
37+
38+
ci_status="pending"
39+
40+
until [[ "$ci_status" != "pending" && "$ci_status" != "running" ]]
41+
do
42+
sleep $POLL_TIMEOUT
43+
ci_output=$(curl --silent "https://${GITLAB_HOSTNAME}/api/v4/projects/${GITLAB_PROJECT_ID}/pipelines/${pipeline_id}")
44+
ci_status=$(jq -n "$ci_output" | jq -r .status)
45+
ci_web_url=$(jq -n "$ci_output" | jq -r .web_url)
46+
47+
echo "Current pipeline status: ${ci_status}"
48+
if [ "$ci_status" = "running" ]
49+
then
50+
echo "Checking pipeline status..."
51+
curl -d '{"state":"pending", "target_url": "'${ci_web_url}'", "context": "gitlab-ci"}' -H "Authorization: token ${GITHUB_TOKEN}" -H "Accept: application/vnd.github.antiope-preview+json" -X POST --silent "https://api.github.com/repos/${GITHUB_REPOSITORY}/statuses/${GITHUB_SHA}" > /dev/null
52+
fi
53+
done
54+
55+
echo "Pipeline finished with status ${ci_status}"
56+
57+
if [ "$ci_status" = "success" ]
58+
then
59+
curl -d '{"state":"success", "target_url": "'${ci_web_url}'", "context": "gitlab-ci"}' -H "Authorization: token ${GITHUB_TOKEN}" -H "Accept: application/vnd.github.antiope-preview+json" -X POST --silent "https://api.github.com/repos/${GITHUB_REPOSITORY}/statuses/${GITHUB_SHA}"
60+
exit 0
61+
elif [ "$ci_status" = "failed" ]
62+
then
63+
curl -d '{"state":"failure", "target_url": "'${ci_web_url}'", "context": "gitlab-ci"}' -H "Authorization: token ${GITHUB_TOKEN}" -H "Accept: application/vnd.github.antiope-preview+json" -X POST --silent "https://api.github.com/repos/${GITHUB_REPOSITORY}/statuses/${GITHUB_SHA}"
64+
exit 1
65+
fi

.github/workflows/test.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: Mirror and run GitLab CI
2+
3+
on: [push]
4+
5+
jobs:
6+
build:
7+
runs-on: ubuntu-latest
8+
steps:
9+
- uses: actions/checkout@v2
10+
- name: Mirror + trigger CI
11+
env:
12+
GITLAB_URL: "https://gitlab.cern.ch/vavolkl/FCCSW"
13+
GITLAB_HOSTNAME: "gitlab.cern.ch"
14+
GITLAB_USERNAME: "vavolkl"
15+
GITLAB_PASSWORD: ${{ secrets.GITLAB_PASSWORD }}
16+
GITLAB_PASSWORD2: ${{ secrets.GITLAB_PASSWORD2 }}
17+
GITLAB_PROJECT_ID: 93907
18+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
19+
POLL_TIMEOUT: 25
20+
run: |
21+
ls -alh
22+
git status
23+
./.github/scripts/gitlabmirror.sh

.gitlab-ci.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# the git version on centos7 is too old for fetch
2+
variables:
3+
GIT_STRATEGY: clone
4+
5+
build-all:
6+
script:
7+
- source init.sh
8+
- mkdir build; cd build; cmake ..; make -j `getconf _NPROCESSORS_ONLN`
9+
- ctest -j `getconf _NPROCESSORS_ONLN`

Examples/options/geant_fastsim_tklayout.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
from GaudiKernel.SystemOfUnits import GeV, TeV
4646
# create particle smearing tool, used for smearing in the tracker
4747
smeartool = SimG4ParticleSmearRootFile("Smear")
48-
smeartool.filename = "root://eosuser.cern.ch//eos/project/f/fccsw-web/testsamples/tkLayout_example_resolutions.root"
48+
smeartool.filename = "http://fccsw.web.cern.ch/fccsw/testsamples/tkLayout_example_resolutions.root"
4949
## create region and a parametrisation model, pass smearing tool
5050
regiontool = SimG4FastSimTrackerRegion("model", volumeNames=["TrackerEnvelopeBarrel"],
5151
minMomentum = 5*GeV, maxMomentum = 10*TeV, maxEta=6, smearing=smeartool)

Jenkinsfile

Lines changed: 0 additions & 22 deletions
This file was deleted.

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,11 @@ Common software for all FCC experiments.
55
This software is based on Gaudi.
66

77

8+
89
Installation
910
------------
1011

12+
1113
Log in to lxplus (CentOS7). Please note that these instructions might not work on another CentOS7 machine.
1214

1315
Clone your fork of this repository:
@@ -33,7 +35,7 @@ Test
3335
----
3436

3537
~~~{.sh}
36-
./run fccrun.py Examples/options/example_options.py
38+
./run fccrun Examples/options/example_options.py
3739
~~~
3840

3941
you can also specify some options like number of events and output file

Reconstruction/RecCalorimeter/tests/options/runBarrelCaloSystem_ReconstructionTopoClusters_electrNoise.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
num_events = 3
1717

1818
#Geometry details to add noise to every Calo cell and paths to root files that have the noise const per cell
19-
ecalBarrelNoisePath = "/eos/project/f/fccsw-web/testsamples/elecAndPileupNoise_ecalBarrel_50Ohm_traces2_2shieldWidth.root"
19+
ecalBarrelNoisePath = "http://fccsw.web.cern.ch/fccsw/testsamples/elecAndPileupNoise_ecalBarrel_50Ohm_traces2_2shieldWidth.root"
2020
ecalBarrelNoiseHistName ="h_elecNoise_fcc_"
2121
#active material identifier name
2222
hcalIdentifierName = [ "module", "row", "layer" ]
@@ -179,12 +179,12 @@
179179
createTopoInput.hcalFwdCells.Path = "emptyCaloCells"
180180

181181
readNeighboursMap =TopoCaloNeighbours("ReadNeighboursMap",
182-
fileName = "/eos/project/f/fccsw-web/testsamples/calo/neighbours_map_barrel.root",
182+
fileName = "http://fccsw.web.cern.ch/fccsw/testsamples/calo/neighbours_map_barrel.root",
183183
OutputLevel = DEBUG)
184184

185185
#Noise levels per cell
186186
readNoisyCellsMap = TopoCaloNoisyCells("ReadNoisyCellsMap",
187-
fileName = "/eos/project/f/fccsw-web/testsamples/calo/cellNoise_map_electronicsNoiseLevel.root",
187+
fileName = "http://fccsw.web.cern.ch/fccsw/testsamples/calo/cellNoise_map_electronicsNoiseLevel.root",
188188
OutputLevel = DEBUG)
189189

190190
createTopoClusters = CaloTopoCluster("CreateTopoClusters",

Reconstruction/RecCalorimeter/tests/options/runBarrelCaloSystem_ReconstructionTopoClusters_electrNoise_coneSelection.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
num_events = 3
1717

1818
#Geometry details to add noise to every Calo cell and paths to root files that have the noise const per cell
19-
ecalBarrelNoisePath = "root://eosuser.cern.ch//eos/project/f/fccsw-web/testsamples/elecNoise_ecalBarrel_50Ohm_traces2_2shieldWidth_noise.root"
19+
ecalBarrelNoisePath = "http://fccsw.web.cern.ch/fccsw/testsamples/elecNoise_ecalBarrel_50Ohm_traces2_2shieldWidth_noise.root"
2020
ecalBarrelNoiseHistName ="h_elecNoise_fcc_"
2121
#active material identifier name
2222
hcalIdentifierName = [ "module", "row", "layer" ]
@@ -187,13 +187,13 @@
187187
createTopoInput.hcalFwdCells.Path = "emptyCaloCells"
188188

189189
readNeighboursMap =TopoCaloNeighbours("ReadNeighboursMap",
190-
fileName = "/eos/project/f/fccsw-web/testsamples/calo/neighbours_map_barrel.root",
190+
fileName = "http://fccsw.web.cern.ch/fccsw/testsamples/calo/neighbours_map_barrel.root",
191191
OutputLevel = DEBUG)
192192

193193
#Noise levels per cell
194194
readNoisyCellsMap = TopoCaloNoisyCells("ReadNoisyCellsMap",
195-
# fileName = "/eos/project/f/fccsw-web/testsamples/calo/cellNoise_map_electronicsNoiseLevel.root",
196-
fileName = "/eos/project/f/fccsw-web/testsamples/calo/cellNoise_map_segHcal_electronicsNoiseLevel.root",
195+
# fileName = "http://fccsw.web.cern.ch/fccsw/testsamples/calo/cellNoise_map_electronicsNoiseLevel.root",
196+
fileName = "http://fccsw.web.cern.ch/fccsw/testsamples/calo/cellNoise_map_segHcal_electronicsNoiseLevel.root",
197197
OutputLevel = DEBUG)
198198

199199
createTopoClusters = CaloTopoCluster("CreateTopoClusters",

Reconstruction/RecCalorimeter/tests/options/runBarrelCaloSystem_ReconstructionTopoClusters_electrNoise_fullGran_coneSelection.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -200,13 +200,13 @@
200200

201201
readNeighboursMap =TopoCaloNeighbours("ReadNeighboursMap",
202202
#fileName = "/afs/cern.ch/work/c/cneubuse/public/FCChh/neighbours_map_barrel.root",
203-
fileName = "neighbours_map_fullGran_barrel.root", #/eos/project/f/fccsw-web/testsamples/calo/neighbours_map_barrel.root",
203+
fileName = "neighbours_map_fullGran_barrel.root", #http://fccsw.web.cern.ch/fccsw/testsamples/calo/neighbours_map_barrel.root",
204204
OutputLevel = DEBUG)
205205

206206
#Noise levels per cell
207207
readNoisyCellsMap = TopoCaloNoisyCells("ReadNoisyCellsMap",
208-
fileName = "/eos/project/f/fccsw-web/testsamples/calo/cellNoise_map_electronicsNoiseLevel.root",
209-
# fileName = "/eos/project/f/fccsw-web/testsamples/calo/cellNoise_map_segHcal_electronicsNoiseLevel.root",
208+
fileName = "http://fccsw.web.cern.ch/fccsw/testsamples/calo/cellNoise_map_electronicsNoiseLevel.root",
209+
# fileName = "http://fccsw.web.cern.ch/fccsw/testsamples/calo/cellNoise_map_segHcal_electronicsNoiseLevel.root",
210210
OutputLevel = DEBUG)
211211

212212
createTopoClusters = CaloTopoCluster("CreateTopoClusters",

0 commit comments

Comments
 (0)