build_sdk.yaml 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136
  1. name: Build SDK
  2. concurrency:
  3. group: ${{ github.workflow }}-${{ github.ref }}
  4. cancel-in-progress: true
  5. on:
  6. push:
  7. paths:
  8. - ".github/build_sdk.yaml"
  9. - "Build/**"
  10. - "application/**"
  11. - "NMSIS/**"
  12. - "OS/**"
  13. - "SoC/**"
  14. - "test/**"
  15. - ".github/**"
  16. - ".ci/**"
  17. - "tools/**"
  18. pull_request:
  19. paths:
  20. - ".github/build_sdk.yaml"
  21. - "Build/**"
  22. - "application/**"
  23. - "NMSIS/**"
  24. - "OS/**"
  25. - "SoC/**"
  26. - "test/**"
  27. - ".github/**"
  28. - ".ci/**"
  29. - "tools/**"
  30. jobs:
  31. build:
  32. name: Build SDK
  33. runs-on: ${{ matrix.os }}
  34. strategy:
  35. matrix:
  36. os: [ubuntu-22.04]
  37. soc: [evalsoc, gd32vf103, gd32vw55x]
  38. steps:
  39. - uses: actions/checkout@v4
  40. with:
  41. submodules: recursive
  42. fetch-depth: 0
  43. - name: Caching tools
  44. uses: actions/cache@v4
  45. with:
  46. path: |
  47. prebuilt_tools/*.tar.bz2
  48. prebuilt_tools/*.zip
  49. prebuilt_tools/*.tar.gz
  50. key: build
  51. - name: Prepare Tools for Ubuntu
  52. if: startsWith(matrix.os, 'ubuntu')
  53. run: |
  54. sudo apt-get -q update
  55. sudo apt install -yq python3 python3-pip unzip libz-dev libssl-dev libglib2.0-dev libfdt-dev libpixman-1-dev zlib1g-dev libncursesw5-dev libncursesw5 libgmp-dev libmpfr-dev libmpc-dev
  56. sudo python3 -m pip install -q --upgrade pip
  57. # install to user local storage
  58. # ERROR: Cannot uninstall 'pyserial'. It is a distutils installed project and thus we cannot accurately determine which files belong to it which would lead to only a partial uninstall.
  59. pip3 install -q -r tools/scripts/requirements.txt
  60. mkdir -p prebuilt_tools
  61. export TOOLVER=2025.10
  62. cd prebuilt_tools
  63. echo "Prepare Nuclei Toolchain......"
  64. toolzip=nuclei_riscv_newlibc_prebuilt_linux64_${TOOLVER}.tar.bz2
  65. if [ ! -e $toolzip ] ; then
  66. echo "Download Nuclei toolchain now!"
  67. wget --progress=dot:giga --no-check-certificate https://download.nucleisys.com/upload/files/toolchain/gcc/$toolzip
  68. ls -lh $toolzip
  69. md5sum $toolzip
  70. fi
  71. tar -xjf $toolzip
  72. echo "Prepare Nuclei QEMU......"
  73. toolzip=nuclei-qemu-${TOOLVER}-linux-x64.tar.gz
  74. if [ ! -e $toolzip ] ; then
  75. echo "Download Nuclei qemu now!"
  76. wget --progress=dot:giga --no-check-certificate https://download.nucleisys.com/upload/files/toolchain/qemu/$toolzip
  77. ls -lh $toolzip
  78. md5sum $toolzip
  79. fi
  80. tar -xzf $toolzip
  81. if [ -d linux_qemu ] ; then
  82. mv linux_qemu qemu
  83. fi
  84. echo "Check gcc and qemu version"
  85. ldd ./qemu/bin/qemu-system-riscv32
  86. ./qemu/bin/qemu-system-riscv32 --version
  87. ./gcc/bin/riscv64-unknown-elf-gcc -v
  88. cd ..
  89. echo "NUCLEI_TOOL_ROOT=$(pwd)/prebuilt_tools" > setup_config.sh
  90. - name: Build and Run SDK for Nuclei Eval SoC
  91. if: matrix.soc == 'evalsoc'
  92. run: |
  93. echo "Setup build environment"
  94. source setup.sh
  95. export APPCFG=tools/scripts/nsdk_cli/configs/application.json
  96. for hwcfg in "nuclei_fpga_eval_ci_qemu_small_gnu" "nuclei_fpga_eval_ci_qemu_small_llvm" ; do
  97. export HWCFG=tools/scripts/nsdk_cli/configs/${hwcfg}.json
  98. export LOGDIR=logs/${hwcfg}
  99. echo "Build and run for ${hwcfg}"
  100. python3 tools/scripts/nsdk_cli/nsdk_bench.py --appcfg $APPCFG --hwcfg $HWCFG --parallel="-j" --logdir $LOGDIR --run_target qemu --run
  101. done
  102. - name: Build SDK for GD32VF103 SoC
  103. if: matrix.soc == 'gd32vf103'
  104. run: |
  105. echo "Setup build environment"
  106. source setup.sh
  107. export APPCFG=tools/scripts/nsdk_cli/configs/application.json
  108. export HWCFG=tools/scripts/nsdk_cli/configs/gd32vf103v_rvstar.json
  109. export LOGDIR=logs/gd32vf103v_rvstar
  110. python3 tools/scripts/nsdk_cli/nsdk_bench.py --appcfg $APPCFG --hwcfg $HWCFG --parallel="-j" --logdir $LOGDIR
  111. - name: Build SDK for GD32VW55X SoC
  112. if: matrix.soc == 'gd32vw55x'
  113. run: |
  114. echo "Setup build environment"
  115. source setup.sh
  116. export APPCFG=tools/scripts/nsdk_cli/configs/application.json
  117. export HWCFG=tools/scripts/nsdk_cli/configs/gd32vw55h_eval.json
  118. export LOGDIR=logs/gd32vw55h_eval
  119. python3 tools/scripts/nsdk_cli/nsdk_bench.py --appcfg $APPCFG --hwcfg $HWCFG --parallel="-j" --logdir $LOGDIR
  120. - name: Upload Build Log for ${{ matrix.soc }}
  121. uses: actions/upload-artifact@v4
  122. with:
  123. name: build_${{ matrix.soc }}
  124. path: |
  125. logs/*