makefile.yml 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. name: Build Check
  2. on:
  3. push:
  4. branches: [ "master" ]
  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. shell: bash -ileo pipefail {0}
  42. env:
  43. ARCH: ${{ matrix.arch }}
  44. run: bash -c "source ~/.cargo/env && cd kernel && make test"
  45. build-x86_64:
  46. runs-on: ubuntu-latest
  47. needs: [ensure-toolchain]
  48. steps:
  49. - uses: actions/checkout@v3
  50. - uses: ./.github/actions/import-toolchain
  51. - name: build the DragonOS
  52. env:
  53. ARCH: x86_64
  54. shell: bash -ileo pipefail {0}
  55. run: |
  56. source ~/.bashrc
  57. source ~/.cargo/env
  58. export DragonOS_GCC=$HOME/opt/dragonos-gcc/gcc-x86_64-unknown-none/bin
  59. make -j $(nproc)
  60. build-riscv64:
  61. runs-on: ubuntu-latest
  62. needs: [ensure-toolchain]
  63. steps:
  64. - uses: actions/checkout@v3
  65. with:
  66. submodules: 'recursive'
  67. - uses: ./.github/actions/import-toolchain
  68. - name: build the DragonOS
  69. shell: bash -ileo pipefail {0}
  70. env:
  71. ARCH: riscv64
  72. run: source ~/.bashrc && source ~/.cargo/env && make kernel -j $(nproc)