Skip to content

Commit 7f83699

Browse files
committed
Split out more jobs
1 parent 85c636d commit 7f83699

File tree

1 file changed

+44
-22
lines changed

1 file changed

+44
-22
lines changed

.github/workflows/clk-rebase.yml

Lines changed: 44 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@ on:
33
workflow_dispatch:
44
push:
55
branches:
6-
- stable_6.12.y
6+
- stable_6.*.y
7+
- clk-rebase-ga
78

89
jobs:
910
clk-rebase:
@@ -13,14 +14,24 @@ jobs:
1314
options: --cpus 8 --privileged
1415
env:
1516
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
17+
# For push events, use the branch that triggered the workflow
18+
# For manual dispatch, default to stable_6.12.y
19+
#STABLE_TRACKING_BRANCH: ${{ github.ref_name || 'stable_6.12.y' }}
20+
STABLE_TRACKING_BRANCH: ${{ 'stable_6.12.y' }}
1621
steps:
17-
- name: Perform CLK Rebase
22+
- name: Set version variables
1823
run: |
19-
CLK_BRANCH=ciq-6.12.y
20-
CLK_NEXT_BRANCH=ciq-6.12.y-next
21-
TMP_CLK_NEXT_BRANCH={automation_tmp}_ciq-6.12.y-next
22-
STABLE_TRACKING_BRANCH=stable_6.12.y
24+
# Extract version from STABLE_TRACKING_BRANCH (e.g., stable_6.12.y -> 6.12.y)
25+
STABLE_BASE_VERSION=$(echo "$STABLE_TRACKING_BRANCH" | sed 's/^stable_//')
26+
echo "STABLE_BASE_VERSION=$STABLE_BASE_VERSION" >> $GITHUB_ENV
2327
28+
# Construct branch names from the base version
29+
echo "CLK_BRANCH=ciq-$STABLE_BASE_VERSION" >> $GITHUB_ENV
30+
echo "CLK_NEXT_BRANCH=ciq-${STABLE_BASE_VERSION}-next" >> $GITHUB_ENV
31+
echo "TMP_CLK_NEXT_BRANCH={automation_tmp}_ciq-${STABLE_BASE_VERSION}-next" >> $GITHUB_ENV
32+
33+
- name: Install system dependencies
34+
run: |
2435
dnf install epel-release -y
2536
dnf install grubby grub2-tools qemu-kvm sudo virtme-ng -y
2637
@@ -34,11 +45,8 @@ jobs:
3445
dnf config-manager --add-repo https://cli.github.com/packages/rpm/gh-cli.repo
3546
dnf install gh -y
3647
37-
WORKDIR=clk-rebase-$(date '+%Y_%m_%d__%H_%M_%S')
38-
mkdir $WORKDIR
39-
pushd $WORKDIR
40-
41-
48+
- name: Clone repositories
49+
run: |
4250
git config --global user.email "[email protected]"
4351
git config --global user.name "Brett Mastbergen"
4452
@@ -48,13 +56,19 @@ jobs:
4856
4957
git clone https://oauth2:[email protected]/ctrliq/kernel-src-tree
5058
51-
pushd kernel-src-tree
59+
- name: Perform rebase
60+
run: |
61+
cd kernel-src-tree
5262
5363
git checkout $STABLE_TRACKING_BRANCH
5464
git checkout $CLK_BRANCH
5565
5666
../kernel-src-tree-tools/lt_rebase.sh
5767
68+
- name: Configure kernel for testing
69+
run: |
70+
cd kernel-src-tree
71+
5872
# need some config tweaks for vng
5973
./scripts/config --file ./ciq/configs/kernel-x86_64.config --enable CONFIG_VSOCKETS
6074
./scripts/config --file ./ciq/configs/kernel-x86_64.config --enable CONFIG_VIRTIO_VSOCKETS
@@ -78,18 +92,30 @@ jobs:
7892
./scripts/config --file ./ciq/configs/kernel-x86_64.config --enable CONFIG_NETFS_SUPPORT
7993
./scripts/config --file ./ciq/configs/kernel-x86_64.config --enable CONFIG_9P_FS
8094
95+
- name: Build kernel
96+
run: |
97+
cd kernel-src-tree
8198
../kernel-src-tree-tools/kernel_build.sh --skip-kabi --no-reboot | tee ../build.log
8299
100+
- name: Install test dependencies
101+
run: |
83102
dnf install curl --allowerasing -y
84-
85103
# should be installed in kernel_kselftest.sh
86104
dnf install conntrack-tools e2fsprogs ethtool iptables iputils ipvsadm kernel-tools nftables teamd traceroute -y
87105
106+
- name: Run selftests
107+
run: |
108+
cd kernel-src-tree
109+
88110
#vng --qemu /usr/libexec/qemu-kvm --force-initramfs --disable-microvm --rw --network user --verbose --memory 16G -- ../kernel-src-tree-tools/kernel_kselftest.sh
89111
90112
# HACK HACK HACK
91113
vng --qemu /usr/libexec/qemu-kvm --force-initramfs --disable-microvm --rw --network user --verbose --memory 16G -- sh -c 'mkdir ../kselftest-logs ; echo ok foo:bar > ../kselftest-logs/selftest-$(uname -r).log'
92114
115+
- name: Extract results and push branches
116+
run: |
117+
cd kernel-src-tree
118+
93119
echo "Selftests passed:"
94120
OK_TESTS=$(grep -a ^ok ../kselftest-logs/selftest* | wc -l)
95121
echo $OK_TESTS
@@ -119,30 +145,26 @@ jobs:
119145
echo "$STABLE_VERSION" > ../stable_version.txt
120146
echo "$OK_TESTS" > ../ok_tests.txt
121147
122-
popd
123-
popd
124-
125148
- name: Upload selftest logs
126149
if: always()
127150
uses: actions/upload-artifact@v4
128151
with:
129152
name: kselftest-logs
130-
path: clk-rebase-*/kselftest-logs/selftest*
153+
path: kselftest-logs/selftest*
131154
if-no-files-found: warn
132155

133156
- name: Upload build log
134157
if: always()
135158
uses: actions/upload-artifact@v4
136159
with:
137160
name: build-log
138-
path: clk-rebase-*/build.log
161+
path: build.log
139162
if-no-files-found: warn
140163

141164
- name: Create Pull Request
142165
if: success()
143166
run: |
144-
WORKDIR=$(ls -d clk-rebase-* | head -1)
145-
cd $WORKDIR/kernel-src-tree
167+
cd kernel-src-tree
146168
147169
STABLE_VERSION=$(cat ../stable_version.txt)
148170
OK_TESTS=$(cat ../ok_tests.txt)
@@ -185,6 +207,6 @@ jobs:
185207
gh pr create \
186208
--title "TESTING TESTING TESTING [CIQ 6.12] Rebase to v${STABLE_VERSION}" \
187209
--body-file /tmp/pr_body.md \
188-
--base ciq-6.12.y-next \
189-
--head {automation_tmp}_ciq-6.12.y-next
210+
--base ${CLK_NEXT_BRANCH} \
211+
--head ${TMP_CLK_NEXT_BRANCH}
190212

0 commit comments

Comments
 (0)