-
Notifications
You must be signed in to change notification settings - Fork 1
271 lines (257 loc) · 10.7 KB
/
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
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
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
name: Validation
on:
workflow_dispatch:
inputs:
source:
required: true
type: string
title:
required: true
type: string
source_url:
required: false
type: string
git_coatjava:
required: false
type: string
git_clas12tags:
required: false
type: string
git_clas12config:
required: false
type: string
pull_request:
push:
branches: [ main ]
run-name: "[${{ inputs.source || github.repository }}] ${{ inputs.title || github.event.pull_request.title || github.event.push.head_commit.message }}"
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
defaults:
run:
shell: bash
env:
# default dependency forks and branches
git_coatjava: '{
"fork": "JeffersonLab/coatjava",
"branch": "development"
}'
git_clas12tags: '{
"fork": "gemc/clas12Tags",
"branch": "main"
}'
git_clas12config: '{
"fork": "JeffersonLab/clas12-config",
"branch": "main",
"tag_config_coatjava": "latest",
"tag_config_gemc": "latest"
}'
# default number of events
num_events: 10
jobs:
# dependency and triggerer info
#############################################################################
dependency_info:
name: Dependency info
runs-on: ubuntu-latest
outputs:
fork_coatjava: ${{ steps.info.outputs.fork_coatjava }}
branch_coatjava: ${{ steps.info.outputs.branch_coatjava }}
fork_clas12tags: ${{ steps.info.outputs.fork_clas12tags }}
branch_clas12tags: ${{ steps.info.outputs.branch_clas12tags }}
fork_clas12config: ${{ steps.info.outputs.fork_clas12config }}
branch_clas12config: ${{ steps.info.outputs.branch_clas12config }}
tag_config_coatjava: ${{ steps.info.outputs.tag_config_coatjava }}
tag_config_gemc: ${{ steps.info.outputs.tag_config_gemc }}
steps:
- name: get dependency info
id: info
run: |
echo fork_coatjava=$( echo '${{ inputs.git_coatjava || env.git_coatjava }}' | jq -r '.fork' ) >> $GITHUB_OUTPUT
echo branch_coatjava=$( echo '${{ inputs.git_coatjava || env.git_coatjava }}' | jq -r '.branch' ) >> $GITHUB_OUTPUT
echo fork_clas12tags=$( echo '${{ inputs.git_clas12tags || env.git_clas12tags }}' | jq -r '.fork' ) >> $GITHUB_OUTPUT
echo branch_clas12tags=$( echo '${{ inputs.git_clas12tags || env.git_clas12tags }}' | jq -r '.branch' ) >> $GITHUB_OUTPUT
echo fork_clas12config=$( echo '${{ inputs.git_clas12config || env.git_clas12config }}' | jq -r '.fork' ) >> $GITHUB_OUTPUT
echo branch_clas12config=$( echo '${{ inputs.git_clas12config || env.git_clas12config }}' | jq -r '.branch' ) >> $GITHUB_OUTPUT
echo tag_config_coatjava=$( echo '${{ inputs.git_clas12config || env.git_clas12config }}' | jq -r '.tag_config_coatjava' ) >> $GITHUB_OUTPUT
echo tag_config_gemc=$( echo '${{ inputs.git_clas12config || env.git_clas12config }}' | jq -r '.tag_config_gemc' ) >> $GITHUB_OUTPUT
- name: dispatch summary
run: |
echo '| | | |' >> $GITHUB_STEP_SUMMARY
echo '| --- | --- | --- |' >> $GITHUB_STEP_SUMMARY
echo '| **Pull Request** | <${{ inputs.source_url || github.event.pull_request.html_url }}> | ${{ inputs.title || github.event.pull_request.title }} |' >> $GITHUB_STEP_SUMMARY
echo '| **`coatjava` Fork and Branch** | `${{ steps.info.outputs.fork_coatjava }}` | [`${{ steps.info.outputs.branch_coatjava }}`](https://github.com/${{ steps.info.outputs.fork_coatjava }}/tree/${{ steps.info.outputs.branch_coatjava }}) |' >> $GITHUB_STEP_SUMMARY
echo '| **`clas12Tags` Fork and Branch** | `${{ steps.info.outputs.fork_clas12tags }}` | [`${{ steps.info.outputs.branch_clas12tags }}`](https://github.com/${{ steps.info.outputs.fork_clas12tags }}/tree/${{ steps.info.outputs.branch_clas12tags }}) |' >> $GITHUB_STEP_SUMMARY
echo '| **`clas12-config` Fork and Branch** | `${{ steps.info.outputs.fork_clas12config }}` | [`${{ steps.info.outputs.branch_clas12config }}`](https://github.com/${{ steps.info.outputs.fork_clas12config }}/tree/${{ steps.info.outputs.branch_clas12config }}) |' >> $GITHUB_STEP_SUMMARY
echo '| | | |' >> $GITHUB_STEP_SUMMARY
# build
#############################################################################
build_coatjava:
needs:
- dependency_info
runs-on: ubuntu-latest
steps:
- name: setup java
uses: actions/setup-java@v3
with:
java-version: 11
distribution: zulu
- name: clone
run: git clone https://github.com/${{ needs.dependency_info.outputs.fork_coatjava }}.git --branch ${{ needs.dependency_info.outputs.branch_coatjava }}
- name: build
run: |
cd coatjava
./build-coatjava.sh
- name: tree
run: tree
- name: tar
run: tar czvf coatjava{.tar.gz,}
- uses: actions/upload-artifact@v3
with:
name: build
retention-days: 1
path: ./*.tar.gz
build_gemc:
needs:
- dependency_info
runs-on: ubuntu-latest
container: jeffersonlab/gemc:4.4.2-5.1-5.2-5.3-fedora36-cvmfs ##### FIXME: need `latest` tag
steps:
- name: clone
run: git clone https://github.com/${{ needs.dependency_info.outputs.fork_clas12tags }}.git --branch ${{ needs.dependency_info.outputs.branch_clas12tags }}
- name: build
run: |
source /app/localSetup.sh
cd clas12Tags/source
scons -j2 OPT=1
echo "### GEMC Build Information:" >> $GITHUB_STEP_SUMMARY
echo '```' >> $GITHUB_STEP_SUMMARY
./gemc -USE_GUI=0 >> $GITHUB_STEP_SUMMARY
echo '```' >> $GITHUB_STEP_SUMMARY
- name: tar
run: tar czvf clas12Tags{.tar.gz,}
- uses: actions/upload-artifact@v3
with:
name: build
retention-days: 1
path: ./*.tar.gz
# clas12-config configuration
#############################################################################
config_files:
name: Configuration files
needs:
- dependency_info
runs-on: ubuntu-latest
outputs:
tag_config_coatjava: ${{ steps.version.outputs.tag_config_coatjava }}
tag_config_gemc: ${{ steps.version.outputs.tag_config_gemc }}
# config_files_json: ${{ steps.config_files_json.outputs.config_files_json }}
steps:
- name: clone
run: git clone https://github.com/${{ needs.dependency_info.outputs.fork_clas12config }}.git --branch ${{ needs.dependency_info.outputs.branch_clas12config }}
- name: get version info
id: version
run: |
cd clas12-config
tag_config_coatjava=${{ needs.dependency_info.outputs.tag_config_coatjava }}
tag_config_gemc=${{ needs.dependency_info.outputs.tag_config_gemc }}
# get the 'latest' version number, if we asked for 'latest'
[ "${{ needs.dependency_info.outputs.tag_config_coatjava }}" = "latest" ] && tag_config_coatjava=$(util/latest.rb coatjava)
[ "${{ needs.dependency_info.outputs.tag_config_gemc }}" = "latest" ] && tag_config_gemc=$(util/latest.rb gemc)
# job summary
echo "### Versions:" >> $GITHUB_STEP_SUMMARY
echo "| Configuration File Set | Version |" >> $GITHUB_STEP_SUMMARY
echo "| --- | --- |" >> $GITHUB_STEP_SUMMARY
echo "| \`coatjava\` | ${tag_config_coatjava} |" >> $GITHUB_STEP_SUMMARY
echo "| \`gemc\` | ${tag_config_gemc} |" >> $GITHUB_STEP_SUMMARY
# output vars
echo tag_config_coatjava=$tag_config_coatjava >> $GITHUB_OUTPUT
echo tag_config_gemc=$tag_config_gemc >> $GITHUB_OUTPUT
# - name: get common config files
# id: config_files_json
# run: |
# cd clas12-config
# config_files_json=$(util/match_configs.rb)
# echo "" >> $GITHUB_STEP_SUMMARY
# echo "### Configurations:" >> $GITHUB_STEP_SUMMARY
# echo '```' >> $GITHUB_STEP_SUMMARY
# echo $config_files_json | jq .config | xargs -0 -I{} echo {} >> $GITHUB_STEP_SUMMARY
# echo '```' >> $GITHUB_STEP_SUMMARY
# echo config_files_json="$config_files_json" >> $GITHUB_OUTPUT
- name: tar
run: tar czvf clas12-config{.tar.gz,}
- uses: actions/upload-artifact@v3
with:
name: build
retention-days: 1
path: ./*.tar.gz
# event generation
#############################################################################
event_generation:
needs:
- build_coatjava
runs-on: ubuntu-latest
steps:
- name: setup java
uses: actions/setup-java@v3
with:
java-version: 11
distribution: zulu
- name: setup groovy
uses: wtfjoke/setup-groovy@v1
with:
groovy-version: 4.x
- uses: actions/download-artifact@v3
with:
name: build
- name: untar build
run: ls *.tar.gz | xargs -I{} tar xzvf {}
- name: event generation
run: |
coatjava/validation/advanced-tests/src/eb/scripts/gen.sh
- uses: actions/upload-artifact@v3
with:
name: event_generation
retention-days: 1
path: ./*.txt
# simulation
#############################################################################
# simulation:
# needs:
# - event_generation
# - build_gemc
# - config_files
# runs-on: ubuntu-latest
# container: jeffersonlab/gemc:4.4.2-5.1-5.2-5.3-fedora36-cvmfs ##### FIXME: need `latest` tag
# strategy:
# fail-fast: false
# matrix: ${{fromJson(needs.config_files.outputs.config_files_json)}}
# steps:
# - uses: actions/download-artifact@v3
# with:
# name: event_generation
# - uses: actions/download-artifact@v3
# with:
# name: build
# - name: tree
# run: ls -lhR
# - name: untar build
# run: ls *.tar.gz | xargs -I{} tar xzvf {}
# - name: TEST LS CVMFS
# run: |
# echo "ls -l /cvmfs"
# ls -l /cvmfs
# echo ""
# echo "ls -l /cvmfs/oasis.opensciencegrid.org/jlab/hallb/clas12/soft/fedora36-gcc12/sim/2.4/clas12Tags/4.4.2/experiments/clas12/fc/"
# ls -l /cvmfs/oasis.opensciencegrid.org/jlab/hallb/clas12/soft/fedora36-gcc12/sim/2.4/clas12Tags/4.4.2/experiments/clas12/fc/
# - name: simulation
# run: |
# source /app/localSetup.sh
# gemc_config=$(pwd -P)/clas12-config/gemc/${{ needs.config_files.outputs.tag_config_gemc }}
# cd clas12Tags/source
# ./gemc \
# $gemc_config/${{ matrix.run_period }}.gcard \
# -N=${{ env.num_events }} \
# -USE_GUI=0
# echo "[DONE]"
# ls -lthR