Skip to content

Commit 0dbb3e8

Browse files
committed
Merge pull request #7 from quic-viskuma/main
ci: Add support for kernel-topics sync
2 parents 7b2e02d + 8ac8685 commit 0dbb3e8

File tree

2 files changed

+73
-7
lines changed

2 files changed

+73
-7
lines changed

.github/actions/sync/action.yml

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
name: Sync workspace
2+
3+
inputs:
4+
base_branch:
5+
description: Base branch
6+
required: true
7+
default: qcom-next-staging
8+
pr_url:
9+
description: PR url
10+
required: false
11+
pr_number:
12+
description: PR number
13+
required: false
14+
15+
runs:
16+
using: "composite"
17+
steps:
18+
- name: Checkout PR branch
19+
if: ${{ inputs.base_branch }} == 'qcom-next-staging'
20+
uses: actions/checkout@v4
21+
shell: bash
22+
with:
23+
fetch-depth: 0
24+
25+
- name: Configure git
26+
shell: bash
27+
run: |
28+
git config --global user.name "github-actions"
29+
git config --global user.email "github-actions@github.com"
30+
31+
- name: Sync with latest changes
32+
if: ${{ inputs.base_branch }} == 'qcom-next-staging'
33+
shell: bash
34+
run: |
35+
echo "Syncing with latest changes..."
36+
git fetch origin ${{ inputs.base_branch }}
37+
git merge origin/${{ inputs.base_branch }}
38+
39+
- name: Clone repositories
40+
if: ${{ inputs.base_branch }} != 'qcom-next-staging'
41+
shell: bash
42+
run: |
43+
git clone https://github.com/qualcomm-linux/kernel.git
44+
git clone https://github.com/qualcomm-linux/automerge.git
45+
46+
- name: Create merge configuration
47+
if: ${{ inputs.base_branch }} != 'qcom-next-staging'
48+
shell: bash
49+
run: |
50+
TOPIC_BRANCH=${{ inputs.base_branch }}
51+
cat <<EOF > merge.conf
52+
baseline git@github.com:qualcomm-linux/kernel.git qcom-next
53+
topic git@github.com:qualcomm-linux/kernel-topics.git $TOPIC_BRANCH
54+
pr ${{ inputs.pr_url }} pull/${{ inputs.pr_number }}/head
55+
EOF
56+
echo "File 'merge.conf' created successfully."
57+
58+
- name: Run auto merge
59+
if: ${{ inputs.base_branch }} != 'qcom-next-staging'
60+
shell: bash
61+
run: |
62+
cd kernel
63+
../automerge/ci-merge -f ../merge.conf -t head -n

.github/workflows/checker.yml

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,12 @@ on:
1818
required: false
1919
type: string
2020
default: qcom-next-staging
21+
pr_url:
22+
type: string
23+
required: false
24+
pr_number:
25+
type: string
26+
required: false
2127

2228
jobs:
2329
checker:
@@ -36,14 +42,11 @@ jobs:
3642
docker build . -t kmake-image
3743
3844
- name: Checkout code
39-
uses: actions/checkout@v4
45+
uses: qualcomm-linux/kernel-checkers/.github/actions/sync
4046
with:
41-
fetch-depth: 0
42-
43-
- name: Merge Base Branch
44-
run: |
45-
git fetch origin ${{ inputs.base_branch }}
46-
git merge origin/${{ inputs.base_branch }}
47+
base_branch: ${{ inputs.base_branch }}
48+
pr_url: ${{ inputs.pr_url }}
49+
pr_number: ${{ inputs.pr_number }}
4750

4851
- name: Clone kernel-checkers
4952
run: cd .. && git clone https://github.com/qualcomm-linux/kernel-checkers.git

0 commit comments

Comments
 (0)