Skip to content

Commit b8c4992

Browse files
[infra] Preserve & replace nightly artifacts across reruns (#57)
* [infra] Preserve nightly artifacts across reruns Defer aggregation and cleanup after matrix failures so selective job reruns can reuse successful jobs' staging artifacts. * [infra] Replace nightly artifacts on reruns Overwrite fixed-name artifacts so selective retries publish current outputs instead of colliding with stale results from earlier attempts.
1 parent f0019f6 commit b8c4992

1 file changed

Lines changed: 29 additions & 4 deletions

File tree

.github/workflows/nightly.yml

Lines changed: 29 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -272,6 +272,7 @@ jobs:
272272
with:
273273
path: output/dist/cuvslam-docs-${{ needs.check-changes.outputs.package_version }}.tar.gz
274274
archive: false
275+
overwrite: true
275276
retention-days: 30
276277
if-no-files-found: error
277278

@@ -294,6 +295,7 @@ jobs:
294295
output/eval/kpi_*.json
295296
output/eval/kpi_*.json.table
296297
output/eval/kpi_*.json.drift
298+
overwrite: true
297299
retention-days: 1
298300
if-no-files-found: warn
299301

@@ -303,6 +305,7 @@ jobs:
303305
with:
304306
name: ${{ env.EVAL_REPORT_ARTIFACT }}-${{ needs.check-changes.outputs.package_version }}-${{ matrix.platform }}-cuda${{ matrix.cuda }}-ubuntu${{ matrix.ubuntu }}
305307
path: output/eval/stats/**/report_*.pdf
308+
overwrite: true
306309
retention-days: 1
307310
if-no-files-found: warn
308311

@@ -315,6 +318,7 @@ jobs:
315318
output/cpp-test-results.xml
316319
output/python-test-output.txt
317320
output/test-summary.txt
321+
overwrite: true
318322
retention-days: 1
319323
if-no-files-found: warn
320324

@@ -324,6 +328,7 @@ jobs:
324328
with:
325329
path: output/dist/cuvslam-cpp-${{ needs.check-changes.outputs.package_version }}-${{ matrix.platform }}-cuda${{ matrix.cuda }}-ubuntu${{ matrix.ubuntu }}.tar.gz
326330
archive: false
331+
overwrite: true
327332
retention-days: 30
328333
if-no-files-found: error
329334

@@ -333,6 +338,7 @@ jobs:
333338
with:
334339
path: output/wheel/*.whl
335340
archive: false
341+
overwrite: true
336342
retention-days: 30
337343
if-no-files-found: error
338344

@@ -349,23 +355,29 @@ jobs:
349355
contents: read
350356
steps:
351357
- name: Download test result artifacts
352-
if: needs.check-changes.outputs.should_build == 'true'
358+
if: >-
359+
needs.check-changes.outputs.should_build == 'true' &&
360+
needs.build-and-test.result == 'success'
353361
continue-on-error: true
354362
uses: actions/download-artifact@v8
355363
with:
356364
pattern: ${{ env.TEST_RESULTS_ARTIFACT }}-${{ needs.check-changes.outputs.package_version }}-*
357365
path: artifacts/test-results
358366

359367
- name: Download KPI staging artifacts
360-
if: needs.check-changes.outputs.should_build == 'true'
368+
if: >-
369+
needs.check-changes.outputs.should_build == 'true' &&
370+
needs.build-and-test.result == 'success'
361371
continue-on-error: true
362372
uses: actions/download-artifact@v8
363373
with:
364374
pattern: ${{ env.EVAL_KPIS_ARTIFACT }}-${{ needs.check-changes.outputs.package_version }}-*
365375
path: artifacts/kpis
366376

367377
- name: Download evaluation report staging artifacts
368-
if: needs.check-changes.outputs.should_build == 'true'
378+
if: >-
379+
needs.check-changes.outputs.should_build == 'true' &&
380+
needs.build-and-test.result == 'success'
369381
continue-on-error: true
370382
uses: actions/download-artifact@v8
371383
with:
@@ -412,6 +424,17 @@ jobs:
412424
exit 0
413425
fi
414426
427+
if [ "${{ needs.build-and-test.result }}" != "success" ]; then
428+
{
429+
echo "Artifact consolidation is deferred until all matrix jobs succeed."
430+
echo "Per-configuration staging artifacts are retained for selective job reruns."
431+
echo ""
432+
} >> "$REPORT"
433+
echo "has_test_results=false" >> "$GITHUB_OUTPUT"
434+
echo "has_reports=false" >> "$GITHUB_OUTPUT"
435+
exit 0
436+
fi
437+
415438
test_config_count=0
416439
TEST_ARTIFACT_PREFIX="${TEST_RESULTS_ARTIFACT}-${PACKAGE_VERSION}-"
417440
for testdir in artifacts/test-results/${TEST_ARTIFACT_PREFIX}*; do
@@ -517,6 +540,7 @@ jobs:
517540
with:
518541
name: test-results-${{ needs.check-changes.outputs.package_version }}
519542
path: consolidated/test-results/
543+
overwrite: true
520544
retention-days: 30
521545
if-no-files-found: error
522546

@@ -552,12 +576,13 @@ jobs:
552576
with:
553577
path: consolidated/cuvslam-evaluation-${{ needs.check-changes.outputs.package_version }}.tar.gz
554578
archive: false
579+
overwrite: true
555580
retention-days: 30
556581
if-no-files-found: error
557582

558583
- name: Delete staging artifacts
559584
id: finalize-artifacts
560-
if: always()
585+
if: always() && needs.build-and-test.result == 'success'
561586
uses: actions/github-script@v7
562587
env:
563588
PACKAGE_VERSION: ${{ needs.check-changes.outputs.package_version }}

0 commit comments

Comments
 (0)