test-build.yaml 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. name: Test Build
  2. on:
  3. push:
  4. branches-ignore:
  5. - comp-and-judge
  6. pull_request:
  7. branches-ignore:
  8. - comp-and-judge
  9. workflow_dispatch:
  10. jobs:
  11. build-and-run-test:
  12. runs-on: ubuntu-latest
  13. strategy:
  14. fail-fast: false
  15. matrix:
  16. arch: [riscv64, loongarch64]
  17. include:
  18. - arch: riscv64
  19. target: riscv64gc-unknown-none-elf
  20. platform: virt
  21. - arch: loongarch64
  22. target: loongarch64-unknown-none-softfloat
  23. platform: virt
  24. steps:
  25. - name: Checkout code
  26. uses: actions/checkout@v4
  27. - name: Setup rust nightly
  28. run: rustup component add rust-src llvm-tools
  29. - name: Setup QEMU
  30. run: |
  31. sudo apt-get update
  32. sudo apt-get install -y qemu-system-${{ matrix.arch }} qemu-kvm expect
  33. - name: Configure
  34. run: ./configure
  35. - name: Run build for ${{ matrix.arch }} targets
  36. run: |
  37. make build ARCH=${{ matrix.arch }} MODE=release
  38. zstd -k build/boot-${{ matrix.arch }}-${{ matrix.platform }}.img
  39. - name: Upload build artifacts
  40. uses: actions/upload-artifact@v4
  41. with:
  42. name: eonix-kernel-and-image-${{ matrix.arch }}
  43. path: |
  44. build/${{ matrix.target }}/release/eonix_kernel
  45. build/boot-${{ matrix.arch }}-${{ matrix.platform }}.img.zst
  46. - name: Test run for ${{ matrix.arch }}
  47. run: |
  48. echo "Fixing permissions for /dev/kvm..."
  49. sudo adduser $USER kvm
  50. sh script/test.sh
  51. env:
  52. ARCH: ${{ matrix.arch }}
  53. QEMU_ACCEL: ''
  54. timeout-minutes: 2
  55. continue-on-error: true
  56. - name: Upload run log
  57. uses: actions/upload-artifact@v4
  58. with:
  59. name: test-${{ matrix.arch }}.log
  60. path: build/test-*.log