makefile.yml 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. name: Build Check
  2. on:
  3. push:
  4. branches: [ "master" ]
  5. pull_request:
  6. branches: [ "master" ]
  7. jobs:
  8. build:
  9. runs-on: ubuntu-latest
  10. steps:
  11. - uses: actions/checkout@v3
  12. - name: Cache DragonOS GCC
  13. id: cache-dragonos-gcc
  14. uses: actions/cache@v3
  15. env:
  16. cache-name: cache-dragonos-gcc
  17. with:
  18. path: |
  19. ~/opt
  20. key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('tools/build_gcc_toolchain.sh') }}
  21. - if: ${{ steps.cache-dragonos-gcc.outputs.cache-hit != 'true' }}
  22. name: build dragonos-gcc
  23. continue-on-error: true
  24. run: bash tools/build_gcc_toolchain.sh -f
  25. - name: Cache build tools
  26. id: cache-build-tools
  27. uses: actions/cache@v3
  28. env:
  29. cache-name: cache-build-tools
  30. with:
  31. path: |
  32. ~/.cargo
  33. key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('.github/workflows/makefile.yml') }}
  34. - if: ${{ steps.cache-build-tools.outputs.cache-hit != 'true' }}
  35. name: Install toolchain
  36. continue-on-error: true
  37. run: sudo apt install -y llvm-dev libclang-dev clang gcc-multilib && cargo install cargo-binutils && rustup toolchain install nightly && rustup default nightly && rustup component add rust-src && rustup component add llvm-tools-preview && rustup target add x86_64-unknown-none
  38. - name: build the DragonOS
  39. run: bash -c "source ~/.cargo/env && export DragonOS_GCC=$HOME/opt/dragonos-gcc/gcc-x86_64-unknown-none/bin && make -j $(nproc) "