makefile.yml 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  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. ~/.rustup
  34. ~/.bashrc
  35. key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('.github/workflows/makefile.yml') }}
  36. - if: ${{ steps.cache-build-tools.outputs.cache-hit != 'true' }}
  37. name: Install toolchain
  38. continue-on-error: true
  39. 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 && rustup component add rust-src --toolchain nightly-x86_64-unknown-linux-gnu && cargo install --git https://github.com/DragonOS-Community/DADK.git
  40. - name: build the DragonOS
  41. run: bash -c "source ~/.cargo/env && export DragonOS_GCC=$HOME/opt/dragonos-gcc/gcc-x86_64-unknown-none/bin && make -j $(nproc) "