.gitlab-ci.yml 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. stages:
  2. - build
  3. - test
  4. variables:
  5. IDF_REPO: ${GITLAB_SSH_SERVER}/espressif/esp-idf.git
  6. STM32_CUBE_F4_REPO: https://github.com/STMicroelectronics/STM32CubeF4
  7. SERIAL_FLASHER_REPO: ${GITLAB_SSH_SERVER}/espressif/esp-serial-flasher.git
  8. QEMU_PATH: /opt/qemu/bin/qemu-system-xtensa
  9. .clone_and_setup_idf: &clone_and_setup_idf |
  10. cit_add_ssh_key "${GITLAB_KEY}"
  11. git clone "${IDF_REPO}"
  12. cd esp-idf
  13. tools/idf_tools.py --non-interactive install all && eval "$(tools/idf_tools.py --non-interactive export)" || exit 1
  14. git submodule update --init
  15. export IDF_PATH=$(pwd)
  16. .clone_and_setup_stm32: &clone_and_setup_stm32 |
  17. cd $CI_PROJECT_DIR
  18. git submodule update --init
  19. git clone "${STM32_CUBE_F4_REPO}"
  20. mkdir $CI_PROJECT_DIR/examples/stm32_example/build
  21. wget -O gcc-arm-none-eabi.tar.bz2 'https://developer.arm.com/-/media/Files/downloads/gnu-rm/9-2020q2/gcc-arm-none-eabi-9-2020-q2-update-x86_64-linux.tar.bz2?revision=05382cca-1721-44e1-ae19-1e7c3dc96118&la=en&hash=D7C9D18FCA2DD9F894FD9F3C3DC9228498FA281A'
  22. tar -xjf gcc-arm-none-eabi.tar.bz2
  23. mv gcc-arm-none-eabi-* gcc-arm-none-eabi
  24. before_script:
  25. # Use CI Tools
  26. - curl -sSL ${CIT_LOADER_URL} | sh
  27. - source citools/import_functions
  28. - PATH=$CI_PROJECT_DIR/esp-idf/tools:$PATH
  29. build_with_idf:
  30. stage: build
  31. image: ${CI_DOCKER_REGISTRY}/esp32-ci-env
  32. tags:
  33. - build
  34. - internet
  35. script:
  36. - *clone_and_setup_idf
  37. - cd $CI_PROJECT_DIR/examples/flash_multiple_partitions
  38. - idf.py build
  39. - cd $CI_PROJECT_DIR/examples/flash_at_firmware
  40. - idf.py build
  41. - *clone_and_setup_stm32
  42. - cd $CI_PROJECT_DIR/examples/stm32_example/build
  43. - cmake -DTOOLCHAIN_PREFIX=$CI_PROJECT_DIR/gcc-arm-none-eabi -DSTM32Cube_DIR=$CI_PROJECT_DIR/STM32CubeF4 .. && cmake --build .
  44. run_tests:
  45. stage: test
  46. image: ${CI_DOCKER_REGISTRY}/qemu:esp-develop-20191124
  47. tags:
  48. - build
  49. - internet
  50. script:
  51. - cd $CI_PROJECT_DIR/test
  52. - dd if=/dev/zero bs=1024 count=4096 of="empty_file.bin"
  53. # Run QEMU in backround (deamonized)
  54. - ${QEMU_PATH}
  55. -daemonize
  56. -machine esp32
  57. -drive file=empty_file.bin,if=mtd,format=raw
  58. -global driver=esp32.gpio,property=strap_mode,value=0x0f
  59. -serial tcp::5555,server,nowait
  60. - cd $CI_PROJECT_DIR/test && mkdir build && cd build
  61. # Compile and run qemu tests
  62. - cmake .. -DQEMU_TEST=True && make && ./serial_flasher_test
  63. # Compile and run host tests
  64. - cmake .. -DQEMU_TEST=False && make && ./serial_flasher_test