makefile.yml 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  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. dadk_version: 0.1.1
  31. with:
  32. path: |
  33. ~/.cargo
  34. ~/.rustup
  35. ~/.bashrc
  36. key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ env.dadk_version }}-${{ hashFiles('.github/workflows/makefile.yml') }}
  37. - if: ${{ steps.cache-build-tools.outputs.cache-hit != 'true' }}
  38. name: Install toolchain
  39. continue-on-error: true
  40. run: sudo sh -c "apt update && apt install -y llvm-dev libclang-dev clang gcc-multilib libssl-dev" && 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 dadk --version 0.1.1
  41. - name: build the DragonOS
  42. run: bash -c "source ~/.cargo/env && export DragonOS_GCC=$HOME/opt/dragonos-gcc/gcc-x86_64-unknown-none/bin && make -j $(nproc) "