Skip to content

Merge pull request #3254 from CosmosOS/feature/xhci-usb-keyboard #46

Merge pull request #3254 from CosmosOS/feature/xhci-usb-keyboard

Merge pull request #3254 from CosmosOS/feature/xhci-usb-keyboard #46

Workflow file for this run

name: Kernel Tests
on:
push:
branches: [ "main", "gen3" ]
paths:
- 'src/**'
- 'tests/Cosmos.TestRunner.**'
- 'tests/Kernels/**'
- '.github/workflows/kernel-tests.yml'
- '.github/workflows/kernel-setup.yml'
- '.github/workflows/kernel-test-run.yml'
- '.github/workflows/kernel-test-results.yml'
pull_request:
branches: [ "**" ]
paths:
- 'src/**'
- 'tests/Cosmos.TestRunner.**'
- 'tests/Kernels/**'
- '.github/workflows/kernel-tests.yml'
- '.github/workflows/kernel-setup.yml'
- '.github/workflows/kernel-test-run.yml'
- '.github/workflows/kernel-test-results.yml'
workflow_dispatch:
inputs:
architecture:
description: 'Architecture to test'
required: false
default: 'all'
type: choice
options:
- all
- x64
- arm64
permissions:
contents: read
checks: write
jobs:
# ── Setup ─────────────────────────────────────────────────────────────────────
setup:
uses: ./.github/workflows/kernel-setup.yml
# ── HelloWorld ────────────────────────────────────────────────────────────────
helloworld-tests:
needs: setup
uses: ./.github/workflows/kernel-test-run.yml
with:
suite_name: HelloWorld
suite_id: helloworld
kernel_path: tests/Kernels/Cosmos.Kernel.Tests.HelloWorld
timeout_x64: 60
timeout_arm64: 90
step_timeout_minutes: 5
helloworld-results:
needs: helloworld-tests
if: always()
uses: ./.github/workflows/kernel-test-results.yml
with:
suite_name: HelloWorld
suite_id: helloworld
kernel_path: tests/Kernels/Cosmos.Kernel.Tests.HelloWorld
event_name: ${{ github.event_name }}
head_ref: ${{ github.head_ref || github.ref_name }}
# ── Memory ────────────────────────────────────────────────────────────────────
memory-tests:
needs: setup
uses: ./.github/workflows/kernel-test-run.yml
with:
suite_name: Memory
suite_id: memory
kernel_path: tests/Kernels/Cosmos.Kernel.Tests.Memory
timeout_x64: 120
timeout_arm64: 180
step_timeout_minutes: 10
memory-results:
needs: memory-tests
if: always()
uses: ./.github/workflows/kernel-test-results.yml
with:
suite_name: Memory
suite_id: memory
kernel_path: tests/Kernels/Cosmos.Kernel.Tests.Memory
event_name: ${{ github.event_name }}
head_ref: ${{ github.head_ref || github.ref_name }}
# ── TypeCasting ───────────────────────────────────────────────────────────────
typecasting-tests:
needs: setup
uses: ./.github/workflows/kernel-test-run.yml
with:
suite_name: TypeCasting
suite_id: typecasting
kernel_path: tests/Kernels/Cosmos.Kernel.Tests.TypeCasting
timeout_x64: 120
timeout_arm64: 180
step_timeout_minutes: 10
typecasting-results:
needs: typecasting-tests
if: always()
uses: ./.github/workflows/kernel-test-results.yml
with:
suite_name: TypeCasting
suite_id: typecasting
kernel_path: tests/Kernels/Cosmos.Kernel.Tests.TypeCasting
event_name: ${{ github.event_name }}
head_ref: ${{ github.head_ref || github.ref_name }}
# ── Timer ─────────────────────────────────────────────────────────────────────
timer-tests:
needs: setup
uses: ./.github/workflows/kernel-test-run.yml
with:
suite_name: Timer
suite_id: timer
kernel_path: tests/Kernels/Cosmos.Kernel.Tests.Timer
timeout_x64: 120
timeout_arm64: 180
step_timeout_minutes: 10
timer-results:
needs: timer-tests
if: always()
uses: ./.github/workflows/kernel-test-results.yml
with:
suite_name: Timer
suite_id: timer
kernel_path: tests/Kernels/Cosmos.Kernel.Tests.Timer
event_name: ${{ github.event_name }}
head_ref: ${{ github.head_ref || github.ref_name }}
# ── Network ───────────────────────────────────────────────────────────────────
network-tests:
needs: setup
uses: ./.github/workflows/kernel-test-run.yml
with:
suite_name: Network
suite_id: network
kernel_path: tests/Kernels/Cosmos.Kernel.Tests.Network
timeout_x64: 120
timeout_arm64: 180
step_timeout_minutes: 10
network-results:
needs: network-tests
if: always()
uses: ./.github/workflows/kernel-test-results.yml
with:
suite_name: Network
suite_id: network
kernel_path: tests/Kernels/Cosmos.Kernel.Tests.Network
event_name: ${{ github.event_name }}
head_ref: ${{ github.head_ref || github.ref_name }}
# ── Runtime ───────────────────────────────────────────────────────────────────
runtime-tests:
needs: setup
uses: ./.github/workflows/kernel-test-run.yml
with:
suite_name: Runtime
suite_id: runtime
kernel_path: tests/Kernels/Cosmos.Kernel.Tests.Runtime
timeout_x64: 120
timeout_arm64: 180
step_timeout_minutes: 10
runtime-results:
needs: runtime-tests
if: always()
uses: ./.github/workflows/kernel-test-results.yml
with:
suite_name: Runtime
suite_id: runtime
kernel_path: tests/Kernels/Cosmos.Kernel.Tests.Runtime
event_name: ${{ github.event_name }}
head_ref: ${{ github.head_ref || github.ref_name }}
# ── Threading ─────────────────────────────────────────────────────────────────
threading-tests:
needs: setup
uses: ./.github/workflows/kernel-test-run.yml
with:
suite_name: Threading
suite_id: threading
kernel_path: tests/Kernels/Cosmos.Kernel.Tests.Threading
# The scheduling-policy cells run three fixed CPU-share measurement
# windows on top of the lock/mutex waits, which TCG stretches further.
timeout_x64: 150
timeout_arm64: 240
step_timeout_minutes: 12
threading-results:
needs: threading-tests
if: always()
uses: ./.github/workflows/kernel-test-results.yml
with:
suite_name: Threading
suite_id: threading
kernel_path: tests/Kernels/Cosmos.Kernel.Tests.Threading
event_name: ${{ github.event_name }}
head_ref: ${{ github.head_ref || github.ref_name }}
# ── Math ─────────────────────────────────────────────────────────────────────
math-tests:
needs: setup
uses: ./.github/workflows/kernel-test-run.yml
with:
suite_name: Math
suite_id: math
kernel_path: tests/Kernels/Cosmos.Kernel.Tests.Math
timeout_x64: 120
timeout_arm64: 180
step_timeout_minutes: 10
math-results:
needs: math-tests
if: always()
uses: ./.github/workflows/kernel-test-results.yml
with:
suite_name: Math
suite_id: math
kernel_path: tests/Kernels/Cosmos.Kernel.Tests.Math
event_name: ${{ github.event_name }}
head_ref: ${{ github.head_ref || github.ref_name }}
# ── Graphic ───────────────────────────────────────────────────────────────────
graphic-tests:
needs: setup
uses: ./.github/workflows/kernel-test-run.yml
with:
suite_name: Graphic
suite_id: graphic
kernel_path: tests/Kernels/Cosmos.Kernel.Tests.Graphic
timeout_x64: 60
timeout_arm64: 90
step_timeout_minutes: 5
graphic-results:
needs: graphic-tests
if: always()
uses: ./.github/workflows/kernel-test-results.yml
with:
suite_name: Graphic
suite_id: graphic
kernel_path: tests/Kernels/Cosmos.Kernel.Tests.Graphic
event_name: ${{ github.event_name }}
head_ref: ${{ github.head_ref || github.ref_name }}
# ── Power ─────────────────────────────────────────────────────────────────────
# Power exercises Reboot + Shutdown end-to-end. Each fires across a separate
# boot, so the suite needs ~3× the wall time of a single-boot suite.
power-tests:
needs: setup
uses: ./.github/workflows/kernel-test-run.yml
with:
suite_name: Power
suite_id: power
kernel_path: tests/Kernels/Cosmos.Kernel.Tests.Power
timeout_x64: 180
timeout_arm64: 270
step_timeout_minutes: 10
power-results:
needs: power-tests
if: always()
uses: ./.github/workflows/kernel-test-results.yml
with:
suite_name: Power
suite_id: power
kernel_path: tests/Kernels/Cosmos.Kernel.Tests.Power
event_name: ${{ github.event_name }}
head_ref: ${{ github.head_ref || github.ref_name }}
# ── GarbageCollector ──────────────────────────────────────────────────────────
garbagecollector-tests:
needs: setup
uses: ./.github/workflows/kernel-test-run.yml
with:
suite_name: GarbageCollector
suite_id: garbagecollector
kernel_path: tests/Kernels/Cosmos.Kernel.Tests.GarbageCollector
timeout_x64: 120
timeout_arm64: 180
step_timeout_minutes: 10
garbagecollector-results:
needs: garbagecollector-tests
if: always()
uses: ./.github/workflows/kernel-test-results.yml
with:
suite_name: GarbageCollector
suite_id: garbagecollector
kernel_path: tests/Kernels/Cosmos.Kernel.Tests.GarbageCollector
event_name: ${{ github.event_name }}
head_ref: ${{ github.head_ref || github.ref_name }}
# ── Pci ───────────────────────────────────────────────────────────────────────
pci-tests:
needs: setup
uses: ./.github/workflows/kernel-test-run.yml
with:
suite_name: Pci
suite_id: pci
kernel_path: tests/Kernels/Cosmos.Kernel.Tests.Pci
timeout_x64: 60
timeout_arm64: 90
step_timeout_minutes: 5
pci-results:
needs: pci-tests
if: always()
uses: ./.github/workflows/kernel-test-results.yml
with:
suite_name: Pci
suite_id: pci
kernel_path: tests/Kernels/Cosmos.Kernel.Tests.Pci
event_name: ${{ github.event_name }}
head_ref: ${{ github.head_ref || github.ref_name }}
# ── Virtio ────────────────────────────────────────────────────────────────────
virtio-tests:
needs: setup
uses: ./.github/workflows/kernel-test-run.yml
with:
suite_name: Virtio
suite_id: virtio
kernel_path: tests/Kernels/Cosmos.Kernel.Tests.Virtio
timeout_x64: 60
timeout_arm64: 90
step_timeout_minutes: 5
virtio-results:
needs: virtio-tests
if: always()
uses: ./.github/workflows/kernel-test-results.yml
with:
suite_name: Virtio
suite_id: virtio
kernel_path: tests/Kernels/Cosmos.Kernel.Tests.Virtio
event_name: ${{ github.event_name }}
head_ref: ${{ github.head_ref || github.ref_name }}
# ── Storage ───────────────────────────────────────────────────────────────────
storage-tests:
needs: setup
uses: ./.github/workflows/kernel-test-run.yml
with:
suite_name: Storage
suite_id: storage
kernel_path: tests/Kernels/Cosmos.Kernel.Tests.Storage
timeout_x64: 90
timeout_arm64: 180
# arm64 expands to 18 matrix cells ({ahci,nvme,usb} x gic/acpi modifier
# subsets) at up to 180s each; a 5-minute budget would kill the step
# before OutputHandlerXml writes results whenever one cell hangs. The
# job budget must stay above the step budget plus setup/build time.
step_timeout_minutes: 60
job_timeout_minutes: 75
storage-results:
needs: storage-tests
if: always()
uses: ./.github/workflows/kernel-test-results.yml
with:
suite_name: Storage
suite_id: storage
kernel_path: tests/Kernels/Cosmos.Kernel.Tests.Storage
event_name: ${{ github.event_name }}
head_ref: ${{ github.head_ref || github.ref_name }}
# ── Interrupts ────────────────────────────────────────────────────────────────
interrupts-tests:
needs: setup
uses: ./.github/workflows/kernel-test-run.yml
with:
suite_name: Interrupts
suite_id: interrupts
kernel_path: tests/Kernels/Cosmos.Kernel.Tests.Interrupts
timeout_x64: 60
timeout_arm64: 90
# arm64 expands to 3 profile cells (bare/gicv2/gicv3) × up to 90 s of
# QEMU each, plus the publish/ILC/ISO build in the same step. 5 min
# left no headroom: hung cells — the case the QEMU timeouts exist
# for — killed the step before OutputHandlerXml wrote results, and
# the results job showed "No results" instead of the failing cells.
step_timeout_minutes: 10
interrupts-results:
needs: interrupts-tests
if: always()
uses: ./.github/workflows/kernel-test-results.yml
with:
suite_name: Interrupts
suite_id: interrupts
kernel_path: tests/Kernels/Cosmos.Kernel.Tests.Interrupts
event_name: ${{ github.event_name }}
head_ref: ${{ github.head_ref || github.ref_name }}
# ── Fat ───────────────────────────────────────────────────────────────────────
fat-tests:
needs: setup
uses: ./.github/workflows/kernel-test-run.yml
with:
suite_name: Fat
suite_id: fat
kernel_path: tests/Kernels/Cosmos.Kernel.Tests.Fat
timeout_x64: 180
timeout_arm64: 360
step_timeout_minutes: 10
fat-results:
needs: fat-tests
if: always()
uses: ./.github/workflows/kernel-test-results.yml
with:
suite_name: Fat
suite_id: fat
kernel_path: tests/Kernels/Cosmos.Kernel.Tests.Fat
event_name: ${{ github.event_name }}
head_ref: ${{ github.head_ref || github.ref_name }}
# ── File ──────────────────────────────────────────────────────────────────────
file-tests:
needs: setup
uses: ./.github/workflows/kernel-test-run.yml
with:
suite_name: File
suite_id: file
kernel_path: tests/Kernels/Cosmos.Kernel.Tests.File
timeout_x64: 180
timeout_arm64: 360
step_timeout_minutes: 10
file-results:
needs: file-tests
if: always()
uses: ./.github/workflows/kernel-test-results.yml
with:
suite_name: File
suite_id: file
kernel_path: tests/Kernels/Cosmos.Kernel.Tests.File
event_name: ${{ github.event_name }}
head_ref: ${{ github.head_ref || github.ref_name }}
# ── Summary ───────────────────────────────────────────────────────────────────
test-summary:
name: Test Summary
runs-on: ubuntu-24.04
# Both the *-tests and *-results jobs are dependencies: the summary rows
# read `needs.<suite>-tests.result`, and the `needs` context only exposes
# direct dependencies — without the *-tests entries every row evaluates
# to an empty string and renders "Failed" regardless of the real outcome.
needs: [ helloworld-tests, memory-tests, typecasting-tests, timer-tests, network-tests, runtime-tests, threading-tests, math-tests, graphic-tests, power-tests, garbagecollector-tests, interrupts-tests, pci-tests, virtio-tests, storage-tests, fat-tests, file-tests, helloworld-results, memory-results, typecasting-results, timer-results, network-results, runtime-results, threading-results, math-results, graphic-results, power-results, garbagecollector-results, interrupts-results, pci-results, virtio-results, storage-results, fat-results, file-results ]
if: always()
steps:
- name: 📊 Generate Summary
run: |
echo "# 🧪 Kernel Test Suite Summary" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "| Test Suite | Status |" >> $GITHUB_STEP_SUMMARY
echo "|------------|--------|" >> $GITHUB_STEP_SUMMARY
add_row() {
local name=$1
local result=$2
if [ "$result" = "success" ]; then
echo "| $name | ✅ Passed |" >> $GITHUB_STEP_SUMMARY
else
echo "| $name | ❌ Failed |" >> $GITHUB_STEP_SUMMARY
fi
}
add_row "HelloWorld" "${{ needs.helloworld-tests.result }}"
add_row "Memory" "${{ needs.memory-tests.result }}"
add_row "TypeCasting" "${{ needs.typecasting-tests.result }}"
add_row "Timer" "${{ needs.timer-tests.result }}"
add_row "Network" "${{ needs.network-tests.result }}"
add_row "Runtime" "${{ needs.runtime-tests.result }}"
add_row "Math" "${{ needs.math-tests.result }}"
add_row "Threading" "${{ needs.threading-tests.result }}"
add_row "Graphic" "${{ needs.graphic-tests.result }}"
add_row "Power" "${{ needs.power-tests.result }}"
add_row "GarbageCollector" "${{ needs.garbagecollector-tests.result }}"
add_row "Interrupts" "${{ needs.interrupts-tests.result }}"
add_row "Pci" "${{ needs.pci-tests.result }}"
add_row "Storage" "${{ needs.storage-tests.result }}"
add_row "Fat" "${{ needs.fat-tests.result }}"
add_row "File" "${{ needs.file-tests.result }}"
echo "" >> $GITHUB_STEP_SUMMARY
echo "**Run ID:** ${{ github.run_id }}" >> $GITHUB_STEP_SUMMARY
echo "**Commit:** ${{ github.sha }}" >> $GITHUB_STEP_SUMMARY