.gitlab-ci.yml 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. stages:
  2. - build
  3. - test
  4. variables:
  5. IDF_REPO: ${GITLAB_SSH_SERVER}/espressif/esp-idf.git
  6. SERIAL_FLASHER_REPO: ${GITLAB_SSH_SERVER}/espressif/esp-serial-flasher.git
  7. QEMU_PATH: /opt/qemu/bin/qemu-system-xtensa
  8. .clone_and_setup_idf: &clone_and_setup_idf |
  9. cit_add_ssh_key "${GITLAB_KEY}"
  10. git clone "${IDF_REPO}"
  11. cd esp-idf
  12. tools/idf_tools.py --non-interactive install && eval "$(tools/idf_tools.py --non-interactive export)" || exit 1
  13. git submodule update --init
  14. export IDF_PATH=$(pwd)
  15. before_script:
  16. # Use CI Tools
  17. - curl -sSL ${CIT_LOADER_URL} | sh
  18. - source citools/import_functions
  19. - PATH=$CI_PROJECT_DIR/esp-idf/tools:$PATH
  20. build_with_idf:
  21. stage: build
  22. image: ${CI_DOCKER_REGISTRY}/esp32-ci-env
  23. tags:
  24. - build
  25. - internet
  26. script:
  27. - *clone_and_setup_idf
  28. - cd $CI_PROJECT_DIR/example
  29. - idf.py build
  30. run_tests:
  31. stage: test
  32. image: ${CI_DOCKER_REGISTRY}/qemu:esp-develop-20191124
  33. tags:
  34. - build
  35. - internet
  36. script:
  37. - cd $CI_PROJECT_DIR/test
  38. - dd if=/dev/zero bs=1024 count=4096 of="empty_file.bin"
  39. # Run QEMU in backround (deamonized)
  40. - ${QEMU_PATH}
  41. -daemonize
  42. -machine esp32
  43. -drive file=empty_file.bin,if=mtd,format=raw
  44. -global driver=esp32.gpio,property=strap_mode,value=0x0f
  45. -serial tcp::5555,server,nowait
  46. - cd $CI_PROJECT_DIR/test && mkdir build && cd build
  47. # Compile and run qemu tests
  48. - cmake .. -DQEMU_TEST=True && make && ./serial_flasher_test
  49. # Compile and run host tests
  50. - cmake .. -DQEMU_TEST=False && make && ./serial_flasher_test