test_hardware.yml 2.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. name: Hardware Test
  2. on:
  3. pull_request:
  4. push:
  5. release:
  6. types:
  7. - created
  8. # Hardware in the loop (HIL)
  9. # Current self-hosted instance is running on an EPYC 7232 server hosted by HiFiPhile user
  10. # - STM32L412 Nucleo with on-board jlink as ttyACM0
  11. jobs:
  12. stm32l412nucleo-test:
  13. runs-on: [self-hosted, Linux, X64, hifiphile]
  14. steps:
  15. - name: Clean workspace
  16. run: |
  17. echo "Cleaning up previous run"
  18. rm -rf "${{ github.workspace }}"
  19. mkdir -p "${{ github.workspace }}"
  20. - name: Checkout TinyUSB
  21. uses: actions/checkout@v3
  22. - name: Get Dependencies and Build
  23. run: |
  24. git submodule update --init lib/FreeRTOS-Kernel lib/lwip
  25. python3 tools/get_dependencies.py stm32l4
  26. python3 tools/build_family.py stm32l4
  27. - name: Pick-up elf files
  28. run: |
  29. mkdir stm32l412nucleo/
  30. find examples/ -path "*stm32l412nucleo/*.elf" -exec mv {} stm32l412nucleo/ \;
  31. - name: Create flash.sh
  32. run: |
  33. echo > flash.sh 'echo halt > flash.jlink'
  34. echo >> flash.sh 'echo r >> flash.jlink'
  35. echo >> flash.sh 'echo loadfile stm32l412nucleo/$1 >> flash.jlink'
  36. echo >> flash.sh 'echo r >> flash.jlink'
  37. echo >> flash.sh 'echo go >> flash.jlink'
  38. echo >> flash.sh 'echo exit >> flash.jlink'
  39. echo >> flash.sh 'cmdout=$(JLinkExe -device stm32l412kb -if swd -JTAGConf -1,-1 -speed auto -NoGui 1 -ExitOnError 1 -CommandFile flash.jlink)'
  40. echo >> flash.sh 'if (( $? )) ; then echo $cmdout ; fi'
  41. chmod +x flash.sh
  42. - name: Test cdc_dual_ports
  43. run: |
  44. ./flash.sh cdc_dual_ports.elf
  45. while (! ([ -e /dev/ttyACM1 ] && [ -e /dev/ttyACM2 ])) && [ $SECONDS -le 5 ]; do :; done
  46. test -e /dev/ttyACM1 && echo "ttyACM1 exists"
  47. test -e /dev/ttyACM2 && echo "ttyACM2 exists"
  48. # Debian does not auto mount usb drive. skip this test for now
  49. - name: Test cdc_msc
  50. if: false
  51. run: |
  52. ./flash.sh cdc_msc.elf
  53. readme='/media/pi/TinyUSB MSC/README.TXT'
  54. while (! ([ -e /dev/ttyACM1 ] && [ -f "$readme" ])) && [ $SECONDS -le 5 ]; do :; done
  55. test -e /dev/ttyACM1 && echo "ttyACM1 exists"
  56. test -f "$readme" && echo "$readme exists"
  57. cat "$readme"
  58. - name: Test dfu
  59. run: |
  60. ./flash.sh dfu.elf
  61. while (! (dfu-util -l | grep "Found DFU")) && [ $SECONDS -le 5 ]; do :; done
  62. dfu-util -d cafe -a 0 -U dfu0
  63. dfu-util -d cafe -a 1 -U dfu1
  64. grep "TinyUSB DFU! - Partition 0" dfu0
  65. grep "TinyUSB DFU! - Partition 1" dfu1
  66. - name: Test dfu_runtime
  67. run: |
  68. ./flash.sh dfu_runtime.elf
  69. while (! (dfu-util -l | grep "Found Runtime")) && [ $SECONDS -le 5 ]; do :; done
  70. # - name: Test hid_boot_interface
  71. # run: |
  72. # ./flash.sh hid_boot_interface.elf
  73. # while (! (dfu-util -l | grep "Found Runtime")) && [ $SECONDS -le 5 ]; do :; done