test-build.yaml 1.5 KB

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