test-build.yaml 1.5 KB

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