1- name : Single-Package CI Build
1+ name : Single-Package CI Build and Linting
22
33permissions :
44 contents : read
8181 shell : bash
8282
8383 steps :
84-
8584 - name : Checkout daq-release
8685 uses : actions/checkout@main
8786 with :
9998 run : |
10099 echo "Caller branch is " "$CALLER_BRANCH"
101100 echo "Target branch is " "$TARGET_BRANCH"
102- export REPO=$(echo '${{ github.repository }}' | awk -F '/' '{print $2}')
103101
104102 extra_dbt_args=""
105103 if [[ ${{ needs.determine_image.outputs.image }} =~ ^.*stable.* ]]; then
@@ -125,24 +123,17 @@ jobs:
125123 BRANCH="$CALLER_BRANCH"
126124
127125 export REPO=$(echo '${{ github.repository }}' | awk -F '/' '{print $2}')
128- #cd $GITHUB_WORKSPACE/dev-${{ matrix.os_name }}
129-
130- echo "Before script: $(pwd)"
131126
132127 cat << EOF > build_and_lint_package.sh
133128 #!/bin/bash
134129
135130 source /cvmfs/dunedaq.opensciencegrid.org/setup_dunedaq.sh
136131 setup_dbt latest
137132
138- echo "Creating in container: $(pwd)"
139133 dbt-create ${{ steps.get_release_info.outputs.extra_dbt_args }} \
140134 ${{ steps.get_release_info.outputs.release_name}} \
141135 dev-${{ matrix.os_name }}
142-
143- echo "Build area?: $(ls)"
144136 cd dev-${{ matrix.os_name }}
145- echo "Now in: $(pwd)"
146137 source env.sh
147138
148139 cd sourcecode
@@ -178,18 +169,13 @@ jobs:
178169 name : build_log_${{ matrix.os_name }}
179170 path : ${{ github.workspace }}/dev-${{ matrix.os_name }}/log/build*.log
180171
181- - name : Troubleshoot event name
182- run : |
183- echo "Event name = ${{ inputs.caller_event_name }}"
184-
185172 - name : set linting artifact name
186173 id : set_artifact_name
187174 run : |
188175 linting_artifact_name="pull_request_linting_results"
189176 if [[ "${{ inputs.caller_event_name }}" == "schedule" ]]; then
190177 linting_artifact_name="nightly_linting_results"
191178 fi
192- echo "linting_artifact_name=$linting_artifact_name"
193179 echo "linting_artifact_name=$linting_artifact_name" >> "$GITHUB_OUTPUT"
194180
195181 - name : upload linting log file
@@ -212,28 +198,19 @@ jobs:
212198 env :
213199 GH_TOKEN : ${{ github.token }}
214200 run : |
215- #run_id=$(gh run list \
216- # --repo ${{ github.repository }} \
217- # --workflow dunedaq-develop-cpp-ci.yml \
218- # --event schedule \
219- # --limit 1 \
220- # --json databaseId \
221- # --jq '.[0].databaseId')
222-
223- # TODO: Hard-coding alert to a fake scheduled run with linting results
224- # Longer term, the nightly linting should upload linting results and the
225- # above expression should work
201+ run_id=$(gh run list \
202+ --repo ${{ github.repository }} \
203+ --workflow dunedaq-develop-cpp-ci.yml \
204+ --event schedule \
205+ --limit 1 \
206+ --json databaseId \
207+ --jq '.[0].databaseId')
208+
209+ # TODO: Remove hard-coding before merge
226210 run_id=23444192414
227211
228212 echo "run_id=$run_id" >> "$GITHUB_OUTPUT"
229213
230- - name : List artifacts on the target run
231- env :
232- GH_TOKEN : ${{ github.token }}
233- run : |
234- gh api repos/DUNE-DAQ/hdf5libs/actions/runs/${{ steps.latest_nightly.outputs.run_id }}/artifacts \
235- --jq '.artifacts[] | [.name, .expired, .size_in_bytes] | @tsv'
236-
237214 - name : Download latest nightly linting results
238215 uses : actions/download-artifact@main
239216 with :
@@ -248,13 +225,6 @@ jobs:
248225 name : pull_request_linting_results
249226 path : pull_request_linting
250227
251- - name : List contents
252- run : |
253- echo "Where am I?"
254- pwd
255- echo "What's here?"
256- ls -lrt
257-
258228 - name : Compare linting results
259229 id : compare
260230 run : |
@@ -274,9 +244,6 @@ jobs:
274244 pr_linting_results_file=$(find pull_request_linting/ -name "*_linting.log" | tail -n 1)
275245 nightly_linting_results_file=$(find nightly_linting/ -name "*_linting.log" | tail -n 1)
276246
277- echo "pr_linting_results_file=$pr_linting_results"
278- echo "nightly_linting_results_file=$nightly_linting_results"
279-
280247 [[ -f "$pr_linting_results_file" ]] || echo "ERROR: No PR results file; exit 1"
281248 [[ -f "$nightly_linting_results_file" ]] || echo "ERROR: No nightly results file; exit 2"
282249
@@ -299,7 +266,7 @@ jobs:
299266 fi
300267
301268 - name : upload linting diff file
302- if : ${{ always() && steps.compare.outputs.diff_exists == 'true' }}
269+ if : ${{ steps.compare.outputs.diff_exists == 'true' }}
303270 uses : actions/upload-artifact@main
304271 with :
305272 name : linting_diff
0 commit comments