-
Notifications
You must be signed in to change notification settings - Fork 10
Add automated Kernel CI workflow #675
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
53a82b2 to
965ef63
Compare
|
|
||
| - name: Download baseline kselftest logs from base branch | ||
| if: steps.base_branch.outputs.base_branch != '' | ||
| uses: dawidd6/action-download-artifact@v3 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this appear to be a user action, we should do a code audit of this.
@bmastbergen has mentioned this before too, maybe as CIQ we should be authoring our own sort of actions like this so that we can contribute to additional community members and we know a company is behind an action code we're running
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It makes me nervous using third-party actions from who knows where. That being said, they can be extremely useful. I guess the official download artifacts action can't download artifacts from other workflows/branches/PRs which we obviously need here. I don't think we need to hold this PR up by writing our own version of this right now, unless its really trivial. I got as far as "oh great it uses node.js" when looking at dawidd6/action-download-artifact
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, I wasn't able to find any quick solution for this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, this looks like relatively stable develeopment and and has users here and there committing beyond the repo owner.
https://github.com/dawidd6/action-download-artifact/graphs/contributors
It also seeming to be used a lot
https://github.com/dawidd6/action-download-artifact/network/dependents
However can we try using the latest release v11 or at least v6
GHSA-5xr6-xhww-33m4
Update the version and I'll approve.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated the version to v11, will test it once
965ef63 to
f8d9d1c
Compare
Implements a 5-stage GitHub Actions pipeline for automated kernel testing and PR creation.
Uses kernel-container-build automated-testing-v1 branch for build/test tooling.
Stage 1: Build (15-30 min)
- Checkout kernel source + kernel-container-build repo (automated-testing-v1)
- Build kernel in CIQ builder container with kABI checking
- Convert built container to QCOW2 VM image
- Upload: kernel-build.log, QCOW2 image
Stage 2: Boot Verification (2-5 min)
- Download QCOW2 image
- Boot kernel in QEMU (KVM or TCG) and validate login prompt appears
- Upload: boot logs
Stage 3: Kernel Selftests (40-60 min)
- Download QCOW2 image
- Execute comprehensive kselftests in QEMU with dual serial consoles
- Upload: kselftest TAP logs, dmesg output
Stage 4: Compare Results (1-2 min)
Purpose: Detect test regressions by comparing against base branch
Steps:
1. Checkout with full history (fetch-depth: 0)
2. Download current kselftest logs
3. Fetching base branch:
- For pushes: Fetches the base branch where the patches needs to be
merged using the user branch name.
Example :- If user branch pushed is {shreeya}_ciqlts9_2 then
ciqlts9_2 is the base branch.
- For force-pushes: Doesn't do the base branch fetching again, instead uses the
same base branch as detected during the first PR creation and also
compares the result against that base branch.
- Outputs: base_branch (reused by PR stage)
4. Download baseline logs from base branch (searches last 5 successful runs)
5. Compare results:
- Counts passing/failing tests (before/after)
- Fails if >±3 tests changed
- Outputs: comparison_status, comparison_message
Stage 5: Create Pull Request (1-2 min)
Purpose: Auto-create/update PR after all tests pass
Prerequisites: Only runs if build + boot + kselftest passed, no regressions detected
Steps:
1. Check all stages passed and comparison_status != failed
2. Checkout (shallow: fetch-depth: 100) for commit messages
3. Download all artifacts (build/boot/test logs)
4. Extract statistics (pass/fail counts, build times)
5. Get commit info:
- Single commit: Use commit message
- Multiple commits: Create summary
6. Create/Update PR:
- Reuses base_branch from compare-results (no duplication!)
- Generate PR body with test results via create-pr-body.sh
- Creates new PR or updates existing one in case of force pushes
Note :-
1. To skip this github action workflow, add [ci skip] or [skip ci]
into the head commit when pushing the patches.
2. For the CI to generate automatic PRs against a valid branch,
one needs to have the user branch name in the format of
{any_name}_basebranch.
3. Braces and base branch name in the user branch is necessary or else
PR creation stage will fai}_basebranch.
3. Braces and base branch name in the user branch is necessary or else
PR creation stage will fail.
Signed-off-by: Shreeya Patel <[email protected]>
Script to generate detailed PR descriptions with kselftest results. Signed-off-by: Shreeya Patel <[email protected]>
f8d9d1c to
9982c5c
Compare
|
|
||
| - name: Create Pull Request | ||
| env: | ||
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please include this fix cddb0db
So that the pull request workflow is triggered
roxanan1996
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I requires a fix to trigger the pull request workflow when the pull request is created
| BRANCH_NAME="${{ github.ref_name }}" | ||
|
|
||
| # Define whitelist of valid base branches | ||
| VALID_BASES="ciqlts9_2 ciqlts9_4 ciqlts8_6" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor: Can you put a TODO here? I hope soon to use a centralized place from where you can take the base branches.
| This PR has been automatically created after successful completion of all CI stages. | ||
|
|
||
| ## Commit Message(s) | ||
| \`\`\` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I agree with you on this but I thought of not spending too much time in making this look very nice at this stage. My focus was to enable this on multiple platforms first as we have only been able to work on ciqlts9_2 as of now so there is a lot of things to be do yet.
Testing these kind of changes also takes a lot of time because I have to go through all the stages to only test the formatting :(
Anyway since I already had a comment to work on from Maple, I made these changes too and also the ones that you pointed out below.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah lets get the 80-90% done here and make sure it works frequently
| echo "commit_subject=Multiple patches tested ($COMMIT_COUNT commits)" >> $GITHUB_OUTPUT | ||
|
|
||
| # Get all commit messages and save to file | ||
| git log origin/$BASE_BRANCH..HEAD --pretty=format:"### %s%n%n%b%n---" > /tmp/commit_message.txt |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As mentioned in a previous comment, I would guard every separate commit with ```.
Moreover, the full commit message adds a lot of noise.
This should work (adapted from my local script to create pull requests)
COMMIT_SUBJECT=$(cat /tmp/commit_subject.txt)
echo "commit_subject=$COMMIT_SUBJECT" >> $GITHUB_OUTPUT
- # Save full commit message to file
- git log -1 --pretty=%B > /tmp/commit_message.txt
else
# Multiple commits: create summary
echo "commit_subject=Multiple patches tested ($COMMIT_COUNT commits)" >> $GITHUB_OUTPUT
-
- # Get all commit messages and save to file
- git log origin/$BASE_BRANCH..HEAD --pretty=format:"### %s%n%n%b%n---" > /tmp/commit_message.txt
fi
+ # Get all commit messages and save to file (in reverse order)
+ for commit in $(git log origin/$BASE_BRANCH..HEAD --format=%h | tac)
+ git log -1 $commit --format=%B | awk 'BEGIN{print "```"} /^$/{empty++} empty==2{exit} {print} END{print "```"}' >> /tmp/commit_message.txt
+
- name: Create Pull Request
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, I've added this change but will need to test it.
Implements a 5-stage GitHub Actions pipeline for automated kernel testing and PR creation.
Uses kernel-container-build automated-testing-v1 branch for build/test tooling.
Stage 1: Build (15-30 min)
Stage 2: Boot Verification (2-5 min)
Stage 3: Kernel Selftests (40-60 min)
Stage 4: Compare Results (1-2 min)
Purpose: Detect test regressions by comparing against base branch
Steps:
merged using the user branch name.
Example :- If user branch pushed is {shreeya}_ciqlts9_2 then
ciqlts9_2 is the base branch.
same base branch as detected during the first PR creation and also
compares the result against that base branch.
Stage 5: Create Pull Request (1-2 min)
Purpose: Auto-create/update PR after all tests pass
Prerequisites: Only runs if build + boot + kselftest passed, no regressions detected
Steps:
Note :-
into the head commit when pushing the patches.
one needs to have the user branch name in the format of
{any_name}_basebranch.
PR creation stage will fai}_basebranch.
PR creation stage will fail.
Signed-off-by: Shreeya Patel [email protected]