test-build.yaml 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  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 install -y qemu-system-${{ matrix.arch }} qemu-kvm
  30. - name: Configure
  31. run: ./configure
  32. - name: Run build for ${{ matrix.arch }} targets
  33. run: |
  34. make build ARCH=${{ matrix.arch }} MODE=release
  35. zstd -k build/boot-${{ matrix.arch }}.img
  36. - name: Upload build artifacts
  37. uses: actions/upload-artifact@v4
  38. with:
  39. name: eonix-kernel-and-image-${{ matrix.arch }}
  40. path: |
  41. build/${{ matrix.target }}/release/eonix_kernel
  42. build/boot-${{ matrix.arch }}.img.zst
  43. - name: Test run for ${{ matrix.arch }}
  44. run: |
  45. echo "Fixing permissions for /dev/kvm..."
  46. sudo adduser $USER kvm
  47. sh script/test.sh
  48. env:
  49. ARCH: ${{ matrix.arch }}
  50. QEMU_ACCEL: ''
  51. timeout-minutes: 2
  52. continue-on-error: true
  53. - name: Upload run log
  54. uses: actions/upload-artifact@v4
  55. with:
  56. name: test-${{ matrix.arch }}.log
  57. path: build/test-*.log