build_riscv.yml 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. name: Build RISC-V
  2. on:
  3. pull_request:
  4. push:
  5. release:
  6. types:
  7. - created
  8. jobs:
  9. build-riscv:
  10. runs-on: ubuntu-latest
  11. strategy:
  12. fail-fast: false
  13. matrix:
  14. family:
  15. # Alphabetical order
  16. - 'fomu'
  17. - 'gd32vf103'
  18. steps:
  19. - name: Setup Python
  20. uses: actions/setup-python@v2
  21. - name: Checkout TinyUSB
  22. uses: actions/checkout@v2
  23. - name: Checkout common submodules in lib
  24. run: git submodule update --init lib/FreeRTOS-Kernel lib/lwip
  25. - name: Checkout hathach/linkermap
  26. uses: actions/checkout@v2
  27. with:
  28. repository: hathach/linkermap
  29. path: linkermap
  30. - name: Set Toolchain URL
  31. run: echo >> $GITHUB_ENV TOOLCHAIN_URL=https://github.com/xpack-dev-tools/riscv-none-embed-gcc-xpack/releases/download/v10.1.0-1.1/xpack-riscv-none-embed-gcc-10.1.0-1.1-linux-x64.tar.gz
  32. - name: Cache Toolchain
  33. uses: actions/cache@v2
  34. id: cache-toolchain
  35. with:
  36. path: ~/cache/
  37. key: ${{ runner.os }}-21-03-04-${{ env.TOOLCHAIN_URL }}
  38. - name: Install Toolchain
  39. if: steps.cache-toolchain.outputs.cache-hit != 'true'
  40. run: |
  41. mkdir -p ~/cache/toolchain
  42. wget --progress=dot:mega $TOOLCHAIN_URL -O toolchain.tar.gz
  43. tar -C ~/cache/toolchain -xaf toolchain.tar.gz
  44. - name: Set Toolchain Path
  45. run: echo >> $GITHUB_PATH `echo ~/cache/toolchain/*/bin`
  46. - name: Build
  47. run: python3 tools/build_family.py ${{ matrix.family }}
  48. - name: Linker Map
  49. run: |
  50. pip install linkermap/
  51. for ex in `ls -d examples/device/*/`; do \
  52. find ${ex} -name *.map -print -quit | \
  53. xargs -I % sh -c 'echo "::group::%"; linkermap -v %; echo "::endgroup::"'; \
  54. done