Skip to content

Commit f0374fd

Browse files
Add kselftest comparison
Signed-off-by: Shreeya Patel <spatel@ciq.com>
1 parent 4c6ed8a commit f0374fd

File tree

1 file changed

+39
-0
lines changed

1 file changed

+39
-0
lines changed

.github/workflows/kernel-build-and-test-x86_64.yml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -189,3 +189,42 @@ jobs:
189189
output/kselftests-*.log
190190
output/dmesg-*.log
191191
retention-days: 7
192+
193+
compare-results:
194+
name: Compare with previous run
195+
runs-on: kernel-build
196+
needs: test-kselftest
197+
if: success() || failure()
198+
199+
steps:
200+
- name: Download current kselftest logs
201+
uses: actions/download-artifact@v4
202+
with:
203+
name: kselftest-logs-x86_64
204+
path: output-current
205+
206+
- name: Download previous kselftest logs
207+
uses: dawidd6/action-download-artifact@v3
208+
with:
209+
workflow: kernel-build-and-test-x86_64.yml
210+
name: kselftest-logs-x86_64
211+
path: output-previous
212+
branch: ${{ github.ref_name }}
213+
search_artifacts: true
214+
skip_unpack: false
215+
if_no_artifact_found: warn
216+
continue-on-error: true
217+
218+
- name: Compare test results
219+
run: |
220+
if [ -f output-previous/kselftests-*.log ]; then
221+
BEFORE=$(grep -a '^ok' output-previous/kselftests-*.log | wc -l)
222+
AFTER=$(grep -a '^ok' output-current/kselftests-*.log | wc -l)
223+
echo "Previous run: $BEFORE passing tests"
224+
echo "Current run: $AFTER passing tests"
225+
if [ "$AFTER" -lt "$BEFORE" ]; then
226+
echo "::warning::Regression detected: $BEFORE -> $AFTER"
227+
fi
228+
else
229+
echo "No previous results found, skipping comparison"
230+
fi

0 commit comments

Comments
 (0)