|
| 1 | +name: CI |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: [ master, main, dev ] |
| 6 | + pull_request: |
| 7 | + branches: [ master, main ] |
| 8 | + |
| 9 | +jobs: |
| 10 | + build-and-test: |
| 11 | + runs-on: ubuntu-24.04 |
| 12 | + timeout-minutes: 5 |
| 13 | + |
| 14 | + steps: |
| 15 | + - name: Checkout code |
| 16 | + uses: actions/checkout@v4 |
| 17 | + with: |
| 18 | + submodules: recursive |
| 19 | + |
| 20 | + - name: Install dependencies |
| 21 | + run: | |
| 22 | + sudo apt-get update |
| 23 | + sudo apt-get install -y build-essential python3 qemu-system-x86 |
| 24 | +
|
| 25 | + - name: Check QEMU availability |
| 26 | + run: | |
| 27 | + which qemu-system-x86_64 || echo "QEMU not found in PATH" |
| 28 | + ls -la /usr/bin/qemu* || echo "No QEMU binaries found" |
| 29 | +
|
| 30 | + - name: Build project |
| 31 | + run: | |
| 32 | + set -x |
| 33 | + make clean || true |
| 34 | + make Q= # Build without suppressing output |
| 35 | +
|
| 36 | + - name: Verify build |
| 37 | + run: | |
| 38 | + ls -la kvm-dmesg |
| 39 | + file kvm-dmesg |
| 40 | +
|
| 41 | + - name: Run full tests |
| 42 | + env: |
| 43 | + CI: "true" |
| 44 | + run: | |
| 45 | + set -x # Enable verbose output |
| 46 | + cd tests |
| 47 | +
|
| 48 | + echo "Starting full test execution..." |
| 49 | +
|
| 50 | + # Try to clone test repository |
| 51 | + if [ ! -d "kvm-dmesg-ci" ]; then |
| 52 | + echo "Cloning test repository..." |
| 53 | + git clone https://github.com/rayylee/kvm-dmesg-ci.git -b master || { |
| 54 | + echo "WARNING: Could not clone test repository, skipping full tests" |
| 55 | + exit 0 |
| 56 | + } |
| 57 | + fi |
| 58 | +
|
| 59 | + # Check if test kernels are available |
| 60 | + if [ ! -d "kvm-dmesg-ci/kernels" ]; then |
| 61 | + echo "WARNING: No test kernels found, skipping full tests" |
| 62 | + exit 0 |
| 63 | + fi |
| 64 | +
|
| 65 | + # Skip - Tcg `Triple fault` bug for el10 |
| 66 | + rm -rf kvm-dmesg-ci/kernels/el10 || true |
| 67 | +
|
| 68 | + # Run the test script and capture exit code |
| 69 | + timeout 180s bash -x base.sh |
| 70 | + TEST_EXIT_CODE=$? |
| 71 | +
|
| 72 | + echo "Full test script exited with code: $TEST_EXIT_CODE" |
| 73 | + if [ $TEST_EXIT_CODE -ne 0 ]; then |
| 74 | + echo "FULL TESTS FAILED!" |
| 75 | + exit $TEST_EXIT_CODE |
| 76 | + else |
| 77 | + echo "FULL TESTS PASSED!" |
| 78 | + fi |
0 commit comments