-
Notifications
You must be signed in to change notification settings - Fork 8
99 lines (91 loc) · 3.12 KB
/
mass-rebuild-bisect.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
name: Mass Rebuild Bisect
permissions:
contents: read
on:
workflow_dispatch:
inputs:
pkg:
description: "The name of the Fedora package build that you want to bisect."
required: true
type: string
issue:
description: "The id of the issue to update with the bisect results."
required: false
type: string
default: 0
workflow_call:
inputs:
pkg:
description: "The name of the Fedora package build that you want to bisect."
required: true
type: string
issue:
description: "The id of the issue to update with the bisect results."
required: false
type: string
default: 0
jobs:
mass-rebuild-bisect:
if: github.repository_owner == 'fedora-llvm-team'
runs-on: ubuntu-24.04
permissions:
issues: write
container:
image: "ghcr.io/${{ github.repository_owner }}/llvm-snapshots-reproducer"
steps:
- name: Setup ccache
uses: hendrikmuhs/[email protected]
with:
max-size: 8G
key: bisect
- working-directory: /root/llvm-project/
run: |
git fetch origin
bash bisect.sh ${{ inputs.pkg }}
- if: always()
working-directory: /root/llvm-project
id: result
run: |
touch bisect.log
if ! git bisect log; then
touch bisect.log
echo "result=False Positive" >> "$GITHUB_OUTPUT"
else
git bisect log > bisect.log
echo "result=Bisect Complete" >> "$GITHUB_OUTPUT"
fi
- if: always() && inputs.issue != 0
uses: actions/github-script@v7
with:
script: |
const jobs = await github.rest.actions.listJobsForWorkflowRunAttempt({
owner: context.repo.owner,
repo: context.repo.repo,
run_id: context.runId,
attempt_number: process.env.GITHUB_RUN_ATTEMPT
});
var fs = require('fs');
const bisect_log = await fs.readFileSync('/root/llvm-project/bisect.log');
const result_string = "${{ steps.result.outputs.result }}";
const package = '${{ inputs.pkg }}'
github.rest.issues.createComment({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: '${{ inputs.issue }}',
body: `[Bisect](${jobs.data.jobs[0].html_url}) complete for: ${package}\n\n${result_string}\n\n${bisect_log}`
})
if (result_string == "False Positive") {
issue = await github.rest.issues.get({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: '${{ inputs.issue }}'
})
console.log(issue);
var body = issue.data.body.replace(`- [ ] [${package}]`,`- [x] [${package}]`)
github.rest.issues.update({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: '${{ inputs.issue }}',
body: body
})
}