forked from WCSim/WCSim
-
Notifications
You must be signed in to change notification settings - Fork 0
248 lines (218 loc) · 8.8 KB
/
c-cpp.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
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
name: Build & Physics CI
on:
push:
branches: [ develop ]
pull_request_target: #runs on the PR branch, rather than the merge branch. But is required for access to secrets
branches: [ develop ]
release:
concurrency:
#When a PR is pushed too multiple times in a short period, this would usually trigger multiple CI runs
#This setting cancels any in-progress CI when a new push is performed
#But we can have multiple jobs testing different things
# It should be that
# * Each push to a PR cancels any in progress PR CI
# * Each push to develop cancels any in progress develop push-triggered CI
# * It seems that PR merges to develop don't get cancelled. This is actually a good thing
group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}
cancel-in-progress: true
jobs:
build:
runs-on: ubuntu-latest
#This should mean that only one "build" job runs at a time
# Meaning there should be no webpage clashes if multiple CI runs are triggered
# in a short period
concurrency:
group: wcsim_build_and_setup_webpage
cancel-in-progress: false
defaults:
run:
working-directory: /opt/
#run inside a container that has the prerequisites already installed
container:
image: docker://ghcr.io/hyperk/hk-software:0.0.2
credentials:
username: ${{ github.actor }}
password: ${{ secrets.CONTAINER_REPO }}
env:
#TRAVIS_COMMIT: ${{ github.sha }}
TRAVIS_PULL_REQUEST: ${{ github.event.number }}
TRAVIS_PULL_REQUEST_TITLE: ${{ github.event.pull_request.title }}
TRAVIS_COMMIT_MESSAGE: ${{ github.event.head_commit.message }}
GitHubToken: ${{ secrets.VALIDATION_PR }}
ValidationPath: /opt/Validation/
steps:
# Print all the info about the action
- name: Logging
run: |
echo "Test print"
#echo "${{toJSON(github)}}"
- name: Get repo to checkout
id: checkout_repo
uses: haya14busa/action-cond@v1
with:
cond: ${{ github.event_name == 'pull_request_target' }}
if_true: ${{ github.event.pull_request.head.repo.full_name }}
if_false: ${{ github.repository }}
- name: Get SHA to checkout
id: checkout_sha
uses: haya14busa/action-cond@v1
with:
cond: ${{ github.event_name == 'pull_request_target' }}
if_true: ${{ github.event.pull_request.head.sha }}
if_false: ${{ github.sha }}
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- name: Checkout WCSim
uses: actions/checkout@v2
with:
ref: ${{ steps.checkout_sha.outputs.value }}
repository: ${{ steps.checkout_repo.outputs.value }}
- name: Link WCSim directory
run: |
mkdir /opt/WCSim/
ln -s ${GITHUB_WORKSPACE}/ /opt/WCSim/src
- name: Checkout WCSim/Validation
run: |
cd /opt/
git clone --depth 1 https://github.com/WCSim/Validation.git -b master --single-branch
- name: Hack hk-software setup (waiting for new release)
run: |
cd /usr/local/hk/hk-software/install-Linux_x86_64-gcc_8-python_3.8.13/
sed -i -e 's/LD_LIBRARY_PATH=LD_LIBRARY_PATH/LD_LIBRARY_PATH=$LD_LIBRARY_PATH/' setup.sh
- name: Setup prerequisites setup script
run: |
cd /opt/
echo source /usr/local/hk/Geant4/install-Linux_x86_64-gcc_8-python_3.8.13/bin/geant4.sh > /opt/setup.sh
echo source /usr/local/hk/hk-pilot/setup.sh >> /opt/setup.sh
echo source /usr/local/hk/hk-software/install-Linux_x86_64-gcc_8-python_3.8.13/setup.sh >> /opt/setup.sh
- name: Print environment
run: |
source /opt/setup.sh
cd /opt/WCSim
export TRAVIS_COMMIT=${{ steps.checkout_sha.outputs.value }}
env
pwd
ls -a
- name: Test build
run: |
source /opt/setup.sh
cd /opt/WCSim
/opt/Validation/build.sh
echo source /opt/WCSim/install/bin/this_wcsim.sh >> /opt/setup.sh
- name: Setup validation webpage
run: |
source /opt/setup.sh
cd /opt/WCSim/install
export TRAVIS_COMMIT=${{ steps.checkout_sha.outputs.value }}
/opt/Validation/SetupWebpages.sh
physics:
needs: build
continue-on-error: true
strategy:
matrix:
physics_job: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23]
runs-on: ubuntu-latest
defaults:
run:
working-directory: /opt/
#run inside a container that has the prerequisites already installed
container:
image: docker://ghcr.io/hyperk/hk-software:0.0.2
credentials:
username: ${{ github.actor }}
password: ${{ secrets.CONTAINER_REPO }}
env:
#TRAVIS_COMMIT: ${{ github.sha }}
TRAVIS_PULL_REQUEST: ${{ github.event.number }}
TRAVIS_PULL_REQUEST_TITLE: ${{ github.event.pull_request.title }}
TRAVIS_COMMIT_MESSAGE: ${{ github.event.head_commit.message }}
GitHubToken: ${{ secrets.VALIDATION_PR }}
ValidationPath: /opt/Validation/
steps:
- name: Get repo to checkout
id: checkout_repo
uses: haya14busa/action-cond@v1
with:
cond: ${{ github.event_name == 'pull_request_target' }}
if_true: ${{ github.event.pull_request.head.repo.full_name }}
if_false: ${{ github.repository }}
- name: Get SHA to checkout
id: checkout_sha
uses: haya14busa/action-cond@v1
with:
cond: ${{ github.event_name == 'pull_request_target' }}
if_true: ${{ github.event.pull_request.head.sha }}
if_false: ${{ github.sha }}
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- name: Checkout WCSim
uses: actions/checkout@v2
with:
ref: ${{ steps.checkout_sha.outputs.value }}
repository: ${{ steps.checkout_repo.outputs.value }}
- name: Link WCSim directory
run: |
mkdir /opt/WCSim/
ln -s ${GITHUB_WORKSPACE}/ /opt/WCSim/src
- name: Checkout WCSim/Validation
run: |
cd /opt/
git clone --depth 1 https://github.com/WCSim/Validation.git -b master --single-branch
- name: Hack hk-software setup (waiting for new release)
run: |
cd /usr/local/hk/hk-software/install-Linux_x86_64-gcc_8-python_3.8.13/
sed -i -e 's/LD_LIBRARY_PATH=LD_LIBRARY_PATH/LD_LIBRARY_PATH=$LD_LIBRARY_PATH/' setup.sh
- name: Setup prerequisites setup script
run: |
cd /opt/
echo source /usr/local/hk/Geant4/install-Linux_x86_64-gcc_8-python_3.8.13/bin/geant4.sh > /opt/setup.sh
echo source /usr/local/hk/hk-pilot/setup.sh >> /opt/setup.sh
echo source /usr/local/hk/hk-software/install-Linux_x86_64-gcc_8-python_3.8.13/setup.sh >> /opt/setup.sh
- name: Build, with added geometry checks
run: |
source /opt/setup.sh
cd /opt/WCSim
/opt/Validation/build.sh 1
echo source /opt/WCSim/install/bin/this_wcsim.sh >> /opt/setup.sh
- name: Run physics
run: |
source /opt/setup.sh
cd /opt/WCSim/install
echo ${{ matrix.physics_job }}
export TRAVIS_COMMIT=${{ steps.checkout_sha.outputs.value }}
/opt/Validation/RunTests.sh ${{ matrix.physics_job }}
finalise:
needs: physics
continue-on-error: true
runs-on: ubuntu-latest
defaults:
run:
working-directory: /opt/
#run inside a container that has the prerequisites already installed
container:
image: docker://ghcr.io/hyperk/hk-software:0.0.2
credentials:
username: ${{ github.actor }}
password: ${{ secrets.CONTAINER_REPO }}
env:
#TRAVIS_COMMIT: ${{ github.sha }}
TRAVIS_PULL_REQUEST: ${{ github.event.number }}
TRAVIS_PULL_REQUEST_TITLE: ${{ github.event.pull_request.title }}
TRAVIS_COMMIT_MESSAGE: ${{ github.event.head_commit.message }}
GitHubToken: ${{ secrets.VALIDATION_PR }}
ValidationPath: /opt/Validation/
steps:
- name: Get SHA to checkout
id: checkout_sha
uses: haya14busa/action-cond@v1
with:
cond: ${{ github.event_name == 'pull_request_target' }}
if_true: ${{ github.event.pull_request.head.sha }}
if_false: ${{ github.sha }}
- name: Checkout WCSim/Validation
run: |
cd /opt/
git clone --depth 1 https://github.com/WCSim/Validation.git -b master --single-branch
- name: Setup validation webpage
run: |
cd /opt/
export TRAVIS_COMMIT=${{ steps.checkout_sha.outputs.value }}
/opt/Validation/FinaliseWebpages.sh