test-build.yaml 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  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. - arch: loongarch64
  21. target: loongarch64-unknown-none-softfloat
  22. steps:
  23. - name: Checkout code
  24. uses: actions/checkout@v4
  25. - name: Setup rust nightly
  26. run: rustup component add rust-src llvm-tools
  27. - name: Setup QEMU
  28. run: |
  29. sudo apt-get update
  30. sudo apt-get install -y qemu-system-${{ matrix.arch }} qemu-kvm
  31. - name: Configure
  32. run: ./configure
  33. - name: Run build for ${{ matrix.arch }} targets
  34. run: |
  35. make build ARCH=${{ matrix.arch }} MODE=release
  36. zstd -k build/boot-${{ matrix.arch }}.img
  37. - name: Upload build artifacts
  38. uses: actions/upload-artifact@v4
  39. with:
  40. name: eonix-kernel-and-image-${{ matrix.arch }}
  41. path: |
  42. build/${{ matrix.target }}/release/eonix_kernel
  43. build/boot-${{ matrix.arch }}.img.zst
  44. - name: Test run for ${{ matrix.arch }}
  45. run: |
  46. echo "Fixing permissions for /dev/kvm..."
  47. sudo adduser $USER kvm
  48. sh script/test.sh
  49. env:
  50. ARCH: ${{ matrix.arch }}
  51. QEMU_ACCEL: ''
  52. timeout-minutes: 2
  53. continue-on-error: true
  54. - name: Upload run log
  55. uses: actions/upload-artifact@v4
  56. with:
  57. name: test-${{ matrix.arch }}.log
  58. path: build/test-*.log