Skip to content

Commit

Permalink
Merge branch 'main' into splitting-semadeclattr
Browse files Browse the repository at this point in the history
  • Loading branch information
Endilll authored Jun 4, 2024
2 parents b4fb775 + 679f75e commit a6da75a
Show file tree
Hide file tree
Showing 2,064 changed files with 35,947 additions and 14,164 deletions.
10 changes: 10 additions & 0 deletions .github/new-prs-labeler.yml
Original file line number Diff line number Diff line change
Expand Up @@ -717,6 +717,16 @@ backend:AMDGPU:
- '**/*amdgpu*/**'
- '**/*AMDGPU*/**'

backend:NVPTX:
- 'llvm/**/*nvvm*'
- 'llvm/**/*NVVM*'
- 'llvm/**/*nvptx*'
- 'llvm/**/*NVPTX*'
- 'llvm/**/*nvvm*/**'
- 'llvm/**/*NVVM*/**'
- 'llvm/**/*nvptx*/**'
- 'llvm/**/*NVPTX*/**'

backend:RISC-V:
- clang/**/*riscv*
- clang/**/*RISCV*
Expand Down
41 changes: 35 additions & 6 deletions .github/workflows/restart-preempted-libcxx-jobs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
name: "Restart Job"
permissions:
statuses: read
checks: read
checks: write
actions: write
runs-on: ubuntu-latest
steps:
Expand All @@ -35,11 +35,36 @@ jobs:
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}`)
async function create_check_run(conclusion, message) {
// Create a check run on the given workflow run to indicate if
// we are restarting the workflow or not.
if (conclusion != 'success' && conclusion != 'skipped' && conclusion != 'neutral') {
core.setFailed('Invalid conclusion: ' + conclusion)
}
await github.rest.checks.create({
owner: context.repo.owner,
repo: context.repo.repo,
name: 'Restart Preempted Job',
head_sha: wf_run.head_sha,
status: 'completed',
conclusion: conclusion,
output: {
title: 'Restarted Preempted Job',
summary: message
}
})
}
console.log('Listing check runs for suite')
const check_suites = await github.rest.checks.listForSuite({
owner: context.repo.owner,
repo: context.repo.repo,
check_suite_id: context.payload.workflow_run.check_suite_id
check_suite_id: context.payload.workflow_run.check_suite_id,
per_page: 100 // FIXME: We don't have 100 check runs yet, but we should handle this better.
})
check_run_ids = [];
Expand Down Expand Up @@ -83,23 +108,27 @@ jobs:
if (failure_match != null) {
// We only want to restart the workflow if all of the failures were due to preemption.
// We don't want to restart the workflow if there were other failures.
console.log('Choosing not to rerun workflow because we found a non-preemption failure');
console.log('Failure message: ' + annotation.message);
core.notice('Choosing not to rerun workflow because we found a non-preemption failure' +
'Failure message: "' + annotation.message + '"');
await create_check_run('skipped', 'Choosing not to rerun workflow because we found a non-preemption failure\n'
+ 'Failure message: ' + annotation.message)
return;
}
}
}
if (!has_preempted_job) {
console.log('No preempted jobs found. Not restarting workflow.');
core.notice('No preempted jobs found. Not restarting workflow.');
await create_check_run('neutral', 'No preempted jobs found. Not restarting workflow.')
return;
}
console.log("Restarted workflow: " + context.payload.workflow_run.id);
core.notice("Restarted workflow: " + context.payload.workflow_run.id);
await github.rest.actions.reRunWorkflowFailedJobs({
owner: context.repo.owner,
repo: context.repo.repo,
run_id: context.payload.workflow_run.id
})
await create_check_run('success', 'Restarted workflow run due to preempted job')
Loading

0 comments on commit a6da75a

Please sign in to comment.