build_riscv.yml 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. name: Build RISC-V
  2. on:
  3. push:
  4. paths:
  5. - 'src/**'
  6. - 'examples/**'
  7. - 'lib/**'
  8. - 'hw/**'
  9. pull_request:
  10. branches: [ master ]
  11. paths:
  12. - 'src/**'
  13. - 'examples/**'
  14. - 'lib/**'
  15. - 'hw/**'
  16. concurrency:
  17. group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
  18. cancel-in-progress: true
  19. jobs:
  20. build-riscv:
  21. runs-on: ubuntu-latest
  22. strategy:
  23. fail-fast: false
  24. matrix:
  25. family:
  26. # Alphabetical order
  27. - 'fomu'
  28. - 'gd32vf103'
  29. steps:
  30. - name: Setup Python
  31. uses: actions/setup-python@v4
  32. with:
  33. python-version: '3.x'
  34. - name: Checkout TinyUSB
  35. uses: actions/checkout@v3
  36. - name: Checkout common submodules in lib
  37. run: git submodule update --init lib/FreeRTOS-Kernel lib/lwip
  38. - name: Checkout hathach/linkermap
  39. uses: actions/checkout@v3
  40. with:
  41. repository: hathach/linkermap
  42. path: linkermap
  43. - name: Set Toolchain URL
  44. 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
  45. - name: Cache Toolchain
  46. uses: actions/cache@v3
  47. id: cache-toolchain
  48. with:
  49. path: ~/cache/
  50. key: ${{ runner.os }}-21-03-04-${{ env.TOOLCHAIN_URL }}
  51. - name: Install Toolchain
  52. if: steps.cache-toolchain.outputs.cache-hit != 'true'
  53. run: |
  54. mkdir -p ~/cache/toolchain
  55. wget --progress=dot:mega $TOOLCHAIN_URL -O toolchain.tar.gz
  56. tar -C ~/cache/toolchain -xaf toolchain.tar.gz
  57. - name: Set Toolchain Path
  58. run: echo >> $GITHUB_PATH `echo ~/cache/toolchain/*/bin`
  59. - name: Get Dependencies
  60. run: python3 tools/get_dependencies.py ${{ matrix.family }}
  61. - name: Build
  62. run: python3 tools/build_family.py ${{ matrix.family }}
  63. - name: Linker Map
  64. run: |
  65. pip install linkermap/
  66. # find -quit to only print linkermap of 1 board per example
  67. for ex in `ls -d examples/device/*/`
  68. do
  69. find ${ex} -name *.map -print -quit | xargs -I % sh -c 'echo "::group::%"; linkermap -v %; echo "::endgroup::"'
  70. done