Just testing #28
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
| name: CLK Rebase | |
| on: | |
| workflow_dispatch: | |
| push: | |
| branches: | |
| - clk-rebase-ga | |
| jobs: | |
| clk-rebase: | |
| runs-on: kernel-build | |
| container: | |
| image: rockylinux:9.2 | |
| options: --cpus 8 --privileged | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| steps: | |
| - name: Perform CLK Rebase | |
| run: | | |
| CLK_BRANCH=ciq-6.12.y | |
| CLK_NEXT_BRANCH=ciq-6.12.y-next | |
| TMP_CLK_NEXT_BRANCH={automation_tmp}_ciq-6.12.y-next | |
| STABLE_TRACKING_BRANCH=stable_6.12.y | |
| dnf install epel-release -y | |
| dnf install procps-ng -y | |
| free -h | |
| dnf install qemu-kvm virtme-ng -y | |
| dnf groupinstall 'Development Tools' -y | |
| dnf install --enablerepo=crb bc dwarves iproute kernel-devel openssl-devel elfutils-libelf-devel -y | |
| # Install GitHub CLI | |
| dnf install 'dnf-command(config-manager)' -y | |
| dnf config-manager --add-repo https://cli.github.com/packages/rpm/gh-cli.repo | |
| dnf install gh -y | |
| WORKDIR=clk-rebase-$(date '+%Y_%m_%d__%H_%M_%S') | |
| mkdir $WORKDIR | |
| pushd $WORKDIR | |
| git config --global user.email "bmastbergen@ciq.com" | |
| git config --global user.name "Brett Mastbergen" | |
| git clone https://oauth2:$GITHUB_TOKEN@github.com/ctrliq/kernel-src-tree-tools | |
| # HACK HACK HACK | |
| git -C kernel-src-tree-tools checkout normalize-rustc-during-lt_rebase | |
| git clone https://oauth2:$GITHUB_TOKEN@github.com/ctrliq/kernel-src-tree | |
| pushd kernel-src-tree | |
| git checkout $STABLE_TRACKING_BRANCH | |
| git checkout $CLK_BRANCH | |
| ../kernel-src-tree-tools/lt_rebase.sh | |
| vng -b --config ciq/configs/kernel-x86_64.config --verbose | tee ../build.log | |
| # HACK HACK HACK | |
| sed -i 's/sudo//g' ../kernel-src-tree-tools/kernel_kselftest.sh | |
| dnf install curl --allowerasing -y | |
| # should be installed in kernel_kselftest.sh | |
| dnf install conntrack-tools e2fsprogs ethtool iptables iputils ipvsadm kernel-tools nftables teamd traceroute -y | |
| #vng --qemu /usr/libexec/qemu-kvm --force-initramfs --disable-microvm --rw --network user --verbose --memory 16G -- ../kernel-src-tree-tools/kernel_kselftest.sh | |
| # HACK HACK HACK | |
| mkdir ../kselftest-logs | |
| echo ok foo:bar > ../kselftest-logs/selftest-6.12.XX.log | |
| echo "Selftests passed:" | |
| OK_TESTS=$(grep -a ^ok ../kselftest-logs/selftest* | wc -l) | |
| echo $OK_TESTS | |
| # Extract the stable version we rebased onto | |
| STABLE_VERSION=$(git log -1 --format=%s $STABLE_TRACKING_BRANCH | grep -oP 'Linux \K[0-9]+\.[0-9]+\.[0-9]+' || echo "unknown") | |
| echo "Rebased to stable version: $STABLE_VERSION" | |
| # Debug: Show all local branches | |
| echo "Local branches:" | |
| git branch -a | |
| # Push the branches | |
| git push origin $CLK_NEXT_BRANCH | |
| git push origin $TMP_CLK_NEXT_BRANCH | |
| # Save data for PR creation | |
| echo "$STABLE_VERSION" > ../stable_version.txt | |
| echo "$OK_TESTS" > ../ok_tests.txt | |
| popd | |
| popd | |
| - name: Upload selftest logs | |
| if: always() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: kselftest-logs | |
| path: clk-rebase-*/kselftest-logs/selftest* | |
| if-no-files-found: warn | |
| - name: Upload build log | |
| if: always() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: build-log | |
| path: clk-rebase-*/build.log | |
| if-no-files-found: warn | |
| - name: Create Pull Request | |
| if: success() | |
| run: | | |
| WORKDIR=$(ls -d clk-rebase-* | head -1) | |
| cd $WORKDIR/kernel-src-tree | |
| STABLE_VERSION=$(cat ../stable_version.txt) | |
| OK_TESTS=$(cat ../ok_tests.txt) | |
| # Extract abbreviated build log (last 50 lines with timing summary) | |
| BUILD_LOG_SUMMARY=$(tail -50 ../build.log) | |
| # Get artifact URLs (will be available after workflow completes) | |
| RUN_ID="${{ github.run_id }}" | |
| REPO="${{ github.repository }}" | |
| SELFTEST_ARTIFACT_URL="https://github.com/${REPO}/actions/runs/${RUN_ID}" | |
| BUILD_LOG_ARTIFACT_URL="https://github.com/${REPO}/actions/runs/${RUN_ID}" | |
| # Create PR body | |
| cat > /tmp/pr_body.md <<EOF | |
| ## Automated Rebase to v${STABLE_VERSION} | |
| ### Build Log | |
| \`\`\` | |
| ${BUILD_LOG_SUMMARY} | |
| \`\`\` | |
| ### Testing | |
| Selftests passed: **${OK_TESTS}** tests | |
| ### Artifacts | |
| - [Build Log](${BUILD_LOG_ARTIFACT_URL}) | |
| - [Selftest Logs](${SELFTEST_ARTIFACT_URL}) | |
| EOF | |
| # Create the PR | |
| gh pr create \ | |
| --title "TESTING TESTING TESTING [CIQ 6.12] Rebase to v${STABLE_VERSION}" \ | |
| --body-file /tmp/pr_body.md \ | |
| --base ciq-6.12.y-next \ | |
| --head {automation_tmp}_ciq-6.12.y-next | |