|
74 | 74 |
|
75 | 75 | singularity exec --writable-tmpfs ${bind_paths} ${container_path} ${runscript_path} |
76 | 76 |
|
77 | | - # Can potentially do this to get list of tasks |
78 | | - #task_list=$(cylc list test_pp__ptest__ttest) |
79 | | - #task1=$(echo $task_list | cut -d ' ' -f1) .... |
80 | | -
|
81 | 77 | - name: Upload workflow-run log files |
82 | 78 | uses: actions/upload-artifact@v4 |
83 | 79 | with: |
@@ -166,6 +162,106 @@ jobs: |
166 | 162 | exit 2 |
167 | 163 | fi |
168 | 164 |
|
| 165 | + - name: Print stage-history-refined successes or failures |
| 166 | + run: | |
| 167 | + set +e |
| 168 | + # Successes |
| 169 | + success=$(grep -E "CYLC_JOB_EXIT=SUCCEEDED" /contrib-efs/container-test/ppp-setup/cylc-run/test_pp__ptest__ttest/log/job/*/stage-history-refined/0[1-3]/job.status) |
| 170 | + exit_status_1=$? |
| 171 | + # Failures |
| 172 | + failure=$(grep -E "CYLC_JOB_EXIT=ERR" /contrib-efs/container-test/ppp-setup/cylc-run/test_pp__ptest__ttest/log/job/*/stage-history-refined/0[1-3]/job.status) |
| 173 | + exit_status_2=$? |
| 174 | + if [ $exit_status_1 -eq 0 ]; then |
| 175 | + echo $success | sed 's/ /\n/g' #split string by spaces |
| 176 | + elif [ $exit_status_1 -eq 1 ]; then |
| 177 | + echo "No succeeded tasks found" |
| 178 | + else |
| 179 | + echo "WARNING: error with grep execution" |
| 180 | + exit 2 |
| 181 | + fi |
| 182 | + if [ $exit_status_2 -eq 0 ]; then |
| 183 | + echo "Failures found" |
| 184 | + echo $failure | sed 's/ /\n/g' #split string by spaces |
| 185 | + exit 1 #exit with error |
| 186 | + elif [ $exit_status_2 -eq 1 ]; then |
| 187 | + echo "No task failures found." |
| 188 | + else |
| 189 | + echo "WARNING: error with grep execution" |
| 190 | + exit 2 |
| 191 | + fi |
| 192 | +
|
| 193 | + - name: Print refine-diag successes or failures |
| 194 | + run: | |
| 195 | + set +e |
| 196 | + # Successes |
| 197 | + success=$(grep -E "CYLC_JOB_EXIT=SUCCEEDED" /contrib-efs/container-test/ppp-setup/cylc-run/test_pp__ptest__ttest/log/job/*/refineDiag-*/0[1-3]/job.status) |
| 198 | + exit_status_1=$? |
| 199 | +
|
| 200 | + # Failures |
| 201 | + failure=$(grep -E "CYLC_JOB_EXIT=ERR" /contrib-efs/container-test/ppp-setup/cylc-run/test_pp__ptest__ttest/log/job/*/refineDiag-*/0[1-3]/job.status) |
| 202 | + exit_status_2=$? |
| 203 | +
|
| 204 | + if [ $exit_status_1 -eq 0 ]; then |
| 205 | + echo $success | sed 's/ /\n/g' #split string by spaces |
| 206 | +
|
| 207 | + # Check if refine-diag task executed correctly |
| 208 | + # history files copied into another history file |
| 209 | + # ........ |
| 210 | +
|
| 211 | + elif [ $exit_status_1 -eq 1 ]; then |
| 212 | + echo "No succeeded tasks found" |
| 213 | + else |
| 214 | + echo "WARNING: error with grep execution" |
| 215 | + exit 2 |
| 216 | + fi |
| 217 | +
|
| 218 | + if [ $exit_status_2 -eq 0 ]; then |
| 219 | + echo "Failures found" |
| 220 | + echo $failure | sed 's/ /\n/g' #split string by spaces |
| 221 | + exit 1 #exit with error |
| 222 | + elif [ $exit_status_2 -eq 1 ]; then |
| 223 | + echo "No task failures found." |
| 224 | + else |
| 225 | + echo "WARNING: error with grep execution" |
| 226 | + exit 2 |
| 227 | + fi |
| 228 | +
|
| 229 | + - name: Print pre-analysis successes or failures |
| 230 | + run: | |
| 231 | + set +e |
| 232 | + # Successes |
| 233 | + success=$(grep -E "CYLC_JOB_EXIT=SUCCEEDED" /contrib-efs/container-test/ppp-setup/cylc-run/test_pp__ptest__ttest/log/job/*/preAnalysis-*/0[1-3]/job.status) |
| 234 | + exit_status_1=$? |
| 235 | + # Failures |
| 236 | + failure=$(grep -E "CYLC_JOB_EXIT=ERR" /contrib-efs/container-test/ppp-setup/cylc-run/test_pp__ptest__ttest/log/job/*/preAnalysis-*/0[1-3]/job.status) |
| 237 | + exit_status_2=$? |
| 238 | + if [ $exit_status_1 -eq 0 ]; then |
| 239 | + echo $success | sed 's/ /\n/g' #split string by spaces |
| 240 | + # Check if preanalysis task executed correctly: Check database exists |
| 241 | + if [ -s "/contrib-efs/container-test/ppp-setup/cylc-run/test_pp__ptest__ttest/log/db" ]; then |
| 242 | + echo "Pre-analysis task produced non-empty db file" |
| 243 | + exit 0 |
| 244 | + else |
| 245 | + echo "Pre-analysis task did not produce expected, non-empty db file" |
| 246 | + exit 1 |
| 247 | + fi |
| 248 | + elif [ $exit_status_1 -eq 1 ]; then |
| 249 | + echo "No succeeded tasks found" |
| 250 | + else |
| 251 | + echo "WARNING: error with grep execution" |
| 252 | + exit 2 |
| 253 | + fi |
| 254 | + if [ $exit_status_2 -eq 0 ]; then |
| 255 | + echo "Failures found" |
| 256 | + echo $failure | sed 's/ /\n/g' #split string by spaces |
| 257 | + exit 1 #exit with error |
| 258 | + elif [ $exit_status_2 -eq 1 ]; then |
| 259 | + echo "No task failures found." |
| 260 | + else |
| 261 | + echo "WARNING: error with grep execution" |
| 262 | + exit 2 |
| 263 | + fi |
| 264 | +
|
169 | 265 | - name: Print regrid-xy successes or failures |
170 | 266 | run: | |
171 | 267 | set +e |
@@ -446,6 +542,13 @@ jobs: |
446 | 542 | exit 2 |
447 | 543 | fi |
448 | 544 |
|
| 545 | + ## I think this will work (without cylc clean) because the |
| 546 | + ## OUTPUT_DIR is bind mounted from the host |
| 547 | + ## This is to retain clean workspace on cloud and to not waste |
| 548 | + ## allocation |
| 549 | + - name: Clean up output folder |
| 550 | + run: rm -rf /contrib-efs/container-test/ppp-setup/cylc-run/test_pp__ptest__ttest |
| 551 | + |
449 | 552 | ## Keep in here for now as a just in case reference ## |
450 | 553 | # - name: Print any succeeded tasks |
451 | 554 | # run: | |
|
0 commit comments