diff options
author | Louis Dionne <ldionne.2@gmail.com> | 2024-06-14 12:43:12 -0400 |
---|---|---|
committer | Louis Dionne <ldionne.2@gmail.com> | 2024-06-14 12:44:09 -0400 |
commit | c7b32341e9f885cc7e6ba4b2ff017f748a6f76ee (patch) | |
tree | 55cfe1f5330aae195aa43356eba21e82bdda5a6d /.github | |
parent | f808abf508a6b890b40fc2594ea36ce896bb1f37 (diff) | |
download | llvm-c7b32341e9f885cc7e6ba4b2ff017f748a6f76ee.zip llvm-c7b32341e9f885cc7e6ba4b2ff017f748a6f76ee.tar.gz llvm-c7b32341e9f885cc7e6ba4b2ff017f748a6f76ee.tar.bz2 |
[libc++] Rename workflow that restarts preempted jobs
All the libc++ workflows start with `libcxx-`, so use that prefix for
this job as well. Also, remove trailing whitespace from the yaml file.
Diffstat (limited to '.github')
-rw-r--r-- | .github/workflows/libcxx-restart-preempted-jobs.yaml (renamed from .github/workflows/restart-preempted-libcxx-jobs.yaml) | 22 |
1 files changed, 10 insertions, 12 deletions
diff --git a/.github/workflows/restart-preempted-libcxx-jobs.yaml b/.github/workflows/libcxx-restart-preempted-jobs.yaml index f8faaf2..21879ce 100644 --- a/.github/workflows/restart-preempted-libcxx-jobs.yaml +++ b/.github/workflows/libcxx-restart-preempted-jobs.yaml @@ -34,7 +34,7 @@ jobs: script: | const failure_regex = /Process completed with exit code 1./ const preemption_regex = /The runner has received a shutdown signal/ - + const wf_run = context.payload.workflow_run core.notice(`Running on "${wf_run.display_title}" by @${wf_run.actor.login} (event: ${wf_run.event})\nWorkflow run URL: ${wf_run.html_url}`) @@ -80,30 +80,30 @@ jobs: } check_run_ids.push(check_run.id); } - + has_preempted_job = false; for (check_run_id of check_run_ids) { console.log('Listing annotations for check run: ' + check_run_id); - + annotations = await github.rest.checks.listAnnotations({ owner: context.repo.owner, repo: context.repo.repo, check_run_id: check_run_id }) - + for (annotation of annotations.data) { if (annotation.annotation_level != 'failure') { continue; } - + const preemption_match = annotation.message.match(preemption_regex); - + if (preemption_match != null) { console.log('Found preemption message: ' + annotation.message); has_preempted_job = true; } - + const failure_match = annotation.message.match(failure_regex); if (failure_match != null) { // We only want to restart the workflow if all of the failures were due to preemption. @@ -115,14 +115,14 @@ jobs: return; } } - } - + } + if (!has_preempted_job) { core.notice('No preempted jobs found. Not restarting workflow.'); await create_check_run('neutral', 'No preempted jobs found. Not restarting workflow.') return; } - + core.notice("Restarted workflow: " + context.payload.workflow_run.id); await github.rest.actions.reRunWorkflowFailedJobs({ owner: context.repo.owner, @@ -130,5 +130,3 @@ jobs: run_id: context.payload.workflow_run.id }) await create_check_run('success', 'Restarted workflow run due to preempted job') - - |