makefile.yml 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  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. build:
  12. runs-on: ubuntu-latest
  13. needs: [ensure-toolchain]
  14. steps:
  15. - uses: actions/checkout@v3
  16. - name: Cache DragonOS GCC
  17. id: cache-dragonos-gcc
  18. uses: actions/cache@v3
  19. env:
  20. cache-name: cache-dragonos-gcc
  21. with:
  22. path: |
  23. ~/opt
  24. key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('tools/build_gcc_toolchain.sh') }}
  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.2
  31. with:
  32. path: |
  33. ~/.cargo
  34. ~/.rustup
  35. ~/.bashrc
  36. key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ env.dadk_version }}-${{ hashFiles('.github/workflows/cache-toolchain.yml') }}
  37. - name: build the DragonOS
  38. run: bash -c "source ~/.cargo/env && export DragonOS_GCC=$HOME/opt/dragonos-gcc/gcc-x86_64-unknown-none/bin && make -j $(nproc) "