Skip to content

Commit 5837420

Browse files
authored
Try to bring mainline inline with develop
Commiting on behalf of GitHub user @AlexVlx
1 parent cfd8ab3 commit 5837420

File tree

157 files changed

+2581
-990
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

157 files changed

+2581
-990
lines changed
Lines changed: 186 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,186 @@
1+
# name: Backport on Comment
2+
3+
# # Example use: /backport llvm_release_190
4+
# on:
5+
# issue_comment:
6+
# types: [created]
7+
8+
# permissions:
9+
# contents: write
10+
# pull-requests: write
11+
# issues: read
12+
13+
# jobs:
14+
# backport:
15+
# if: >
16+
# github.event.issue.pull_request != null &&
17+
# startsWith(github.event.comment.body, '/backport ')
18+
# runs-on: ubuntu-latest
19+
20+
# steps:
21+
# - name: Checkout repository
22+
# uses: actions/checkout@v4
23+
# with:
24+
# fetch-depth: 0
25+
26+
# - name: Configure Git
27+
# run: |
28+
# git config user.name "${{ github.actor }}"
29+
# git config user.email "${{ github.actor }}@users.noreply.github.com"
30+
31+
# - name: Ensure PR is merged
32+
# uses: actions/github-script@v7
33+
# with:
34+
# script: |
35+
# const pr = await github.rest.pulls.get({
36+
# owner: context.repo.owner,
37+
# repo: context.repo.repo,
38+
# pull_number: context.issue.number
39+
# });
40+
# if (!pr.data.merged) {
41+
# core.setFailed('PR #' + context.issue.number + ' is not merged.');
42+
# }
43+
44+
# - name: Parse backport command
45+
# uses: actions/github-script@v7
46+
# with:
47+
# github-token: ${{ secrets.GITHUB_TOKEN }}
48+
# result-encoding: string
49+
# script: |
50+
# const body = context.payload.comment.body.trim();
51+
# const msg = body.match(/^\/backport\s+(llvm_release_[0-9]+)$/);
52+
# if (!msg) {
53+
# await github.rest.issues.createComment({
54+
# owner: context.repo.owner,
55+
# repo: context.repo.repo,
56+
# issue_number: context.issue.number,
57+
# body: 'Invalid backport command. Expected `/backport llvm_release_<digits>`'
58+
# });
59+
# throw new Error('Invalid backport command.');
60+
# }
61+
# core.exportVariable('TARGET', msg[1]);
62+
63+
# - name: Notify attempt
64+
# uses: actions/github-script@v7
65+
# with:
66+
# script: |
67+
# const target = process.env.TARGET;
68+
# await github.rest.issues.createComment({
69+
# owner: context.repo.owner,
70+
# repo: context.repo.repo,
71+
# issue_number: context.issue.number,
72+
# body: `Attempting to create backport to \`${target}\`...`
73+
# });
74+
75+
# - name: Create backport branch
76+
# run: |
77+
# git fetch origin ${{ env.TARGET }}:${{ env.TARGET }}
78+
# git checkout -b backport/pr-${{ github.event.issue.number }}-to-${{ env.TARGET }} origin/${{ env.TARGET }}
79+
80+
# - name: Get commit sha
81+
# id: merge_sha
82+
# uses: actions/github-script@v7
83+
# with:
84+
# github-token: ${{ secrets.GITHUB_TOKEN }}
85+
# result-encoding: string
86+
# script: |
87+
# const pr = await github.rest.pulls.get({
88+
# owner: context.repo.owner,
89+
# repo: context.repo.repo,
90+
# pull_number: context.issue.number
91+
# });
92+
# // FIXME: handle PRs that are merged with "Rebase and Merge" strategy
93+
# const sha = pr.data.merge_commit_sha;
94+
# if (!sha) {
95+
# throw new Error(`No merge_commit_sha found.`);
96+
# }
97+
# return sha;
98+
99+
# - name: Cherry-pick commit
100+
# id: cherry
101+
# run: |
102+
# conflict=false
103+
# SHA="${{ steps.merge_sha.outputs.result }}"
104+
# echo "Cherry-picking squash-merge commit $SHA"
105+
# if git cherry-pick "$SHA"; then
106+
# echo "Cherry-picked $SHA"
107+
# else
108+
# echo "Conflict on $SHA"
109+
# conflict=true
110+
# echo "CONFLICT_SHA=$SHA" >> $GITHUB_ENV
111+
# fi
112+
# echo "CONFLICT=$conflict" >> $GITHUB_ENV
113+
114+
# - name: Notify conflict
115+
# if: env.CONFLICT == 'true'
116+
# uses: actions/github-script@v7
117+
# with:
118+
# github-token: ${{ secrets.GITHUB_TOKEN }}
119+
# script: |
120+
# const sha = process.env.CONFLICT_SHA;
121+
# const target = process.env.TARGET;
122+
# await github.rest.issues.createComment({
123+
# owner: context.repo.owner,
124+
# repo: context.repo.repo,
125+
# issue_number: context.issue.number,
126+
# body: `Backport to \`${target}\` failed due to conflicts on commit \`${sha}\`. Please backport manually.`
127+
# });
128+
129+
# - name: Stop on conflict
130+
# if: env.CONFLICT == 'true'
131+
# run: exit 0
132+
133+
# - name: Push backport branch
134+
# if: env.CONFLICT == 'false'
135+
# run: git push --set-upstream origin HEAD
136+
137+
# - name: Prepare PR
138+
# if: env.CONFLICT == 'false'
139+
# id: prinfo
140+
# run: |
141+
# echo "BODY<<EOF" >> $GITHUB_ENV
142+
# echo "Backport of PR #${{ github.event.issue.number }} into \`${{ env.TARGET }}\`." >> $GITHUB_ENV
143+
# echo "" >> $GITHUB_ENV
144+
# echo "All commits applied cleanly." >> $GITHUB_ENV
145+
# echo "EOF" >> $GITHUB_ENV
146+
# echo "LABELS=backport" >> $GITHUB_ENV
147+
148+
# - name: Create Pull Request
149+
# if: env.CONFLICT == 'false'
150+
# id: create_pr
151+
# uses: actions/github-script@v7
152+
# with:
153+
# github-token: ${{ secrets.GITHUB_TOKEN }}
154+
# result-encoding: string
155+
# script: |
156+
# const {data: pr} = await github.rest.pulls.create({
157+
# owner: context.repo.owner,
158+
# repo: context.repo.repo,
159+
# head: `backport/pr-${context.issue.number}-to-${process.env.TARGET}`,
160+
# base: process.env.TARGET,
161+
# title: `[Backport to ${process.env.TARGET}] ${context.payload.issue.title}`,
162+
# body: process.env.BODY
163+
# });
164+
# return pr.html_url;
165+
166+
# - name: Notify success
167+
# if: env.CONFLICT == 'false'
168+
# uses: actions/github-script@v7
169+
# env:
170+
# PR_URL: ${{ steps.create_pr.outputs.result }}
171+
# with:
172+
# script: |
173+
# const target = process.env.TARGET;
174+
# await github.rest.issues.createComment({
175+
# owner: context.repo.owner,
176+
# repo: context.repo.repo,
177+
# issue_number: context.issue.number,
178+
# body: `Success. Backport PR created: ${process.env.PR_URL}`
179+
# });
180+
181+
# - name: Notify workflows
182+
# if: env.CONFLICT == 'false'
183+
# uses: peter-evans/repository-dispatch@v3
184+
# with:
185+
# token: ${{ secrets.GITHUB_TOKEN }}
186+
# event-type: backport-complete

.github/workflows/check-code-style.yml

Lines changed: 48 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -18,18 +18,33 @@
1818
# - 'test/**' # tests
1919
# - '**.md' # README
2020
# - '**.txt' # CMakeLists.txt
21-
# - '**/check-**-build.yml' # Other workflows
21+
# - '**/check-**-build.yml' # build workflows
22+
# - '**/backport-to-branch.yml' # backport workflow
23+
# - '**/patch-release.yaml' # patch release workflow
24+
# repository_dispatch:
25+
# types: [backport-complete]
26+
# branches:
27+
# - main
28+
# - llvm_release_*
29+
# paths-ignore: # no need to check formatting for:
30+
# - 'docs/**' # documentation
31+
# - 'test/**' # tests
32+
# - '**.md' # README
33+
# - '**.txt' # CMakeLists.txt
34+
# - '**/check-**-build.yml' # build workflows
35+
# - '**/backport-to-branch.yml' # backport workflow
36+
# - '**/patch-release.yaml' # patch release workflow
2237

2338
# env:
2439
# # We need compile command database in order to perform clang-tidy check. So,
2540
# # in order to perform configure step we need to setup llvm-dev package. This
2641
# # env variable used to specify desired version of it
27-
# LLVM_VERSION: 20
42+
# LLVM_VERSION: 21
2843

2944
# jobs:
3045
# clang-format-and-tidy:
3146
# name: clang-format & clang-tidy
32-
# runs-on: ubuntu-20.04
47+
# runs-on: ubuntu-22.04
3348
# steps:
3449
# - name: Checkout sources
3550
# uses: actions/checkout@v4
@@ -40,37 +55,37 @@
4055
# # base between target branch and PR
4156
# fetch-depth: 2
4257

43-
# - name: Gather list of changes
44-
# id: gather-list-of-changes
45-
# run: |
46-
# git diff -U0 --no-color ${{ github.sha }}^ -- include lib \
47-
# ':(exclude)include/LLVMSPIRVExtensions.inc' \
48-
# ':(exclude)lib/SPIRV/libSPIRV/SPIRVErrorEnum.h' \
49-
# ':(exclude)lib/SPIRV/libSPIRV/SPIRVOpCodeEnum.h' \
50-
# ':(exclude)lib/SPIRV/libSPIRV/SPIRVOpCodeEnumInternal.h' \
51-
# > diff-to-inspect.txt
52-
# if [ -s diff-to-inspect.txt ]; then
53-
# # Here we set an output of our step, which is used later to either
54-
# # perform or skip further steps, i.e. there is no sense to install
55-
# # clang-format if PR hasn't changed .cpp files at all
56-
# # See [workflow-commands] for reference
57-
# echo '::set-output name=HAS_CHANGES::true'
58-
# fi
58+
# - name: Gather list of changes
59+
# id: gather-list-of-changes
60+
# run: |
61+
# git diff -U0 --no-color ${{ github.sha }}^ -- include lib \
62+
# ':(exclude)include/LLVMSPIRVExtensions.inc' \
63+
# ':(exclude)lib/SPIRV/libSPIRV/SPIRVErrorEnum.h' \
64+
# ':(exclude)lib/SPIRV/libSPIRV/SPIRVOpCodeEnum.h' \
65+
# ':(exclude)lib/SPIRV/libSPIRV/SPIRVOpCodeEnumInternal.h' \
66+
# > diff-to-inspect.txt
67+
# if [ -s diff-to-inspect.txt ]; then
68+
# # Here we set an output of our step, which is used later to either
69+
# # perform or skip further steps, i.e. there is no sense to install
70+
# # clang-format if PR hasn't changed .cpp files at all
71+
# # See [workflow-commands] for reference
72+
# echo 'HAS_CHANGES=true' >> "$GITHUB_OUTPUT"
73+
# fi
5974

60-
# - name: Install dependencies
61-
# if: ${{ steps.gather-list-of-changes.outputs.HAS_CHANGES }}
62-
# run: |
63-
# # clang-tidy requires compile command database in order to be properly
64-
# # launched, so, we need to setup llvm package to perform cmake
65-
# # configuration step to generate that database
66-
# curl -L "https://apt.llvm.org/llvm-snapshot.gpg.key" | sudo apt-key add -
67-
# echo "deb https://apt.llvm.org/focal/ llvm-toolchain-focal main" | sudo tee -a /etc/apt/sources.list
68-
# sudo apt-get update
69-
# sudo apt-get install -yqq \
70-
# clang-format-${{ env.LLVM_VERSION }} clang-tidy-${{ env.LLVM_VERSION }} \
71-
# clang-tools-${{ env.LLVM_VERSION }} llvm-${{ env.LLVM_VERSION }}-dev \
72-
# libomp-${{ env.LLVM_VERSION }}-dev libllvmlibc-${{ env.LLVM_VERSION }}-dev \
73-
# mlir-${{ env.LLVM_VERSION }}-tools libpolly-${{ env.LLVM_VERSION }}-dev \
75+
# - name: Install dependencies
76+
# if: ${{ steps.gather-list-of-changes.outputs.HAS_CHANGES }}
77+
# run: |
78+
# # clang-tidy requires compile command database in order to be properly
79+
# # launched, so, we need to setup llvm package to perform cmake
80+
# # configuration step to generate that database
81+
# curl -L "https://apt.llvm.org/llvm-snapshot.gpg.key" | sudo apt-key add -
82+
# echo "deb https://apt.llvm.org/jammy/ llvm-toolchain-jammy main" | sudo tee -a /etc/apt/sources.list
83+
# sudo apt-get update
84+
# sudo apt-get install -yqq \
85+
# clang-format-${{ env.LLVM_VERSION }} clang-tidy-${{ env.LLVM_VERSION }} \
86+
# clang-tools-${{ env.LLVM_VERSION }} llvm-${{ env.LLVM_VERSION }}-dev \
87+
# libomp-${{ env.LLVM_VERSION }}-dev libllvmlibc-${{ env.LLVM_VERSION }}-dev \
88+
# mlir-${{ env.LLVM_VERSION }}-tools libpolly-${{ env.LLVM_VERSION }}-dev \
7489

7590
# - name: Generate compile command database
7691
# if: ${{ steps.gather-list-of-changes.outputs.HAS_CHANGES }}

.github/workflows/check-in-tree-build.yml

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@
1616
# - '**.md' # README
1717
# - '**/check-code-style.yml' # check-code-style workflow
1818
# - '**/check-out-of-tree-build.yml' # check-out-of-tree-build workflow
19+
# - '**/check-out-of-tree-build.yml' # check-out-of-tree-build workflow
20+
# - '**/backport-to-branch.yml' # backport-to-branch workflow
21+
# - '**/patch-release.yaml' # patch-release workflow
1922
# pull_request:
2023
# branches:
2124
# - main
@@ -25,14 +28,29 @@
2528
# - '**.md' # README
2629
# - '**/check-code-style.yml' # check-code-style workflow
2730
# - '**/check-out-of-tree-build.yml' # check-out-of-tree-build workflow
31+
# - '**/backport-to-branch.yml' # backport-to-branch workflow
32+
# - '**/patch-release.yaml' # patch-release workflow
33+
# repository_dispatch:
34+
# types: [backport-complete]
35+
# branches:
36+
# - main
37+
# - llvm_release_*
38+
# paths-ignore: # no need to check formatting for:
39+
# - 'docs/**' # documentation
40+
# - '**.md' # README
41+
# - '**/check-code-style.yml' # check-code-style workflow
42+
# - '**/check-out-of-tree-build.yml' # check-out-of-tree-build workflow
43+
# - '**/backport-to-branch.yml' # backport-to-branch workflow
44+
# - '**/patch-release.yaml' # patch-release workflow
45+
2846
# schedule:
2947
# # Ideally, we might want to simplify our regular nightly build as we
3048
# # probably don't need every configuration to be built every day: most of
3149
# # them are only necessary in pre-commits to avoid breakages
3250
# - cron: 0 0 * * *
3351

3452
# env:
35-
# LLVM_VERSION: 20
53+
# LLVM_VERSION: 21
3654

3755
# jobs:
3856
# build_and_test_linux:

.github/workflows/check-out-of-tree-build.yml

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@
1616
# - '**.md' # README
1717
# - '**/check-code-style.yml' # check-code-style workflow
1818
# - '**/check-in-tree-build.yml' # check-in-tree-build workflow
19+
# - '**/backport-to-branch.yml' # backport-to-branch workflow
20+
# - '**/patch-release.yaml' # patch-release workflow
21+
1922
# pull_request:
2023
# branches:
2124
# - main
@@ -25,11 +28,25 @@
2528
# - '**.md' # README
2629
# - '**/check-code-style.yml' # check-code-style workflow
2730
# - '**/check-in-tree-build.yml' # check-in-tree-build workflow
31+
# - '**/backport-to-branch.yml' # backport-to-branch workflow
32+
# - '**/patch-release.yaml' # patch-release workflow
33+
# repository_dispatch:
34+
# types: [backport-complete]
35+
# branches:
36+
# - main
37+
# - llvm_release_*
38+
# paths-ignore: # no need to check formatting for:
39+
# - 'docs/**' # documentation
40+
# - '**.md' # README
41+
# - '**/check-code-style.yml' # check-code-style workflow
42+
# - '**/check-in-tree-build.yml' # check-in-tree-build workflow
43+
# - '**/backport-to-branch.yml' # backport-to-branch workflow
44+
# - '**/patch-release.yaml' # patch-release workflow
2845
# schedule:
2946
# - cron: 0 0 * * *
3047

3148
# env:
32-
# LLVM_VERSION: 20
49+
# LLVM_VERSION: 21
3350

3451
# jobs:
3552
# build_and_test:

0 commit comments

Comments
 (0)