makefile.yml 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. name: Build Check
  2. on:
  3. push:
  4. branches: [ "master", "patch-add-riscv64-github-workflow" ]
  5. pull_request:
  6. branches: [ "master" ]
  7. jobs:
  8. # ensure the toolchain is cached
  9. ensure-toolchain:
  10. uses: ./.github/workflows/cache-toolchain.yml
  11. format-check:
  12. name: Format check ${{ matrix.arch }}
  13. runs-on: ubuntu-latest
  14. needs: [ensure-toolchain]
  15. continue-on-error: true
  16. strategy:
  17. matrix:
  18. arch: [x86_64, riscv64]
  19. steps:
  20. - uses: actions/checkout@v3
  21. - uses: ./.github/actions/import-toolchain
  22. - name: Format check
  23. env:
  24. ARCH: ${{ matrix.arch }}
  25. run: |
  26. printf "\n" >> kernel/src/include/bindings/bindings.rs
  27. printf "\n" >> user/libs/libc/src/include/internal/bindings/bindings.rs
  28. FMT_CHECK=1 make fmt
  29. kernel-static-test:
  30. name: Kernel static test ${{ matrix.arch }}
  31. runs-on: ubuntu-latest
  32. needs: [ensure-toolchain]
  33. continue-on-error: true
  34. strategy:
  35. matrix:
  36. arch: [x86_64, riscv64]
  37. steps:
  38. - uses: actions/checkout@v3
  39. - uses: ./.github/actions/import-toolchain
  40. - name: Run kernel static test
  41. env:
  42. ARCH: ${{ matrix.arch }}
  43. run: bash -c "source ~/.cargo/env && cd kernel && make test"
  44. build-x86_64:
  45. runs-on: ubuntu-latest
  46. needs: [ensure-toolchain]
  47. steps:
  48. - uses: actions/checkout@v3
  49. - uses: ./.github/actions/import-toolchain
  50. - name: build the DragonOS
  51. env:
  52. ARCH: x86_64
  53. run: bash -c "source ~/.cargo/env && export DragonOS_GCC=$HOME/opt/dragonos-gcc/gcc-x86_64-unknown-none/bin && make -j $(nproc) "
  54. build-riscv64:
  55. runs-on: ubuntu-latest
  56. needs: [ensure-toolchain]
  57. steps:
  58. - uses: actions/checkout@v3
  59. with:
  60. submodules: 'recursive'
  61. - uses: ./.github/actions/import-toolchain
  62. - name: build the DragonOS
  63. env:
  64. ARCH: riscv64
  65. run: bash -c "source ~/.cargo/env && make kernel -j $(nproc)"