makefile.yml 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. name: Build Check
  2. on:
  3. push:
  4. branches: [ "master", "feat-*", "fix-*"]
  5. pull_request:
  6. branches: [ "master", "feat-*", "fix-*"]
  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. FMT_CHECK=1 make fmt
  28. kernel-static-test:
  29. name: Kernel static test ${{ matrix.arch }}
  30. runs-on: ubuntu-latest
  31. needs: [ensure-toolchain]
  32. continue-on-error: true
  33. strategy:
  34. matrix:
  35. arch: [x86_64, riscv64]
  36. steps:
  37. - uses: actions/checkout@v3
  38. - uses: ./.github/actions/import-toolchain
  39. - name: Run kernel static test
  40. shell: bash -ileo pipefail {0}
  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. shell: bash -ileo pipefail {0}
  54. run: |
  55. source ~/.bashrc
  56. source ~/.cargo/env
  57. export DragonOS_GCC=$HOME/opt/dragonos-gcc/gcc-x86_64-unknown-none/bin
  58. make -j $(nproc)
  59. build-riscv64:
  60. runs-on: ubuntu-latest
  61. needs: [ensure-toolchain]
  62. steps:
  63. - uses: actions/checkout@v3
  64. with:
  65. submodules: 'recursive'
  66. - uses: ./.github/actions/import-toolchain
  67. - name: build the DragonOS
  68. shell: bash -ileo pipefail {0}
  69. env:
  70. ARCH: riscv64
  71. run: source ~/.bashrc && source ~/.cargo/env && make kernel -j $(nproc)