stages: - build - test variables: IDF_REPO: ${IDF_GIT_SERVER}/espressif/esp-idf.git STM32_CUBE_F4_REPO: https://github.com/STMicroelectronics/STM32CubeF4 SERIAL_FLASHER_REPO: ${GITLAB_SSH_SERVER}/espressif/esp-serial-flasher.git QEMU_PATH: /opt/qemu/bin/qemu-system-xtensa .clone_and_setup_idf: &clone_and_setup_idf | cit_add_ssh_key "${GITLAB_KEY}" git clone "${IDF_REPO}" cd esp-idf tools/idf_tools.py --non-interactive install all && eval "$(tools/idf_tools.py --non-interactive export)" || exit 1 git submodule update --init export IDF_PATH=$(pwd) .clone_and_setup_stm32: &clone_and_setup_stm32 | cd $CI_PROJECT_DIR git submodule update --init git clone "${STM32_CUBE_F4_REPO}" mkdir $CI_PROJECT_DIR/examples/stm32_example/build 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' tar -xjf gcc-arm-none-eabi.tar.bz2 mv gcc-arm-none-eabi-* gcc-arm-none-eabi before_script: # Use CI Tools - curl -sSL ${CIT_LOADER_URL} | sh - source citools/import_functions - PATH=$CI_PROJECT_DIR/esp-idf/tools:$PATH build_with_idf: stage: build image: ${CI_DOCKER_REGISTRY}/esp32-ci-env tags: - build - internet script: - *clone_and_setup_idf - cd $CI_PROJECT_DIR/examples/esp32_example # Build for all supported targets - idf.py build -DTARGET_SOC=ESP32 -DMD5_ENABLED=1 - idf.py build -DTARGET_SOC=ESP8266 -DMD5_ENABLED=0 - idf.py build -DTARGET_SOC=ESP32_S2 -DMD5_ENABLED=1 - *clone_and_setup_stm32 - cd $CI_PROJECT_DIR/examples/stm32_example/build - cmake -DTOOLCHAIN_PREFIX=$CI_PROJECT_DIR/gcc-arm-none-eabi -DSTM32Cube_DIR=$CI_PROJECT_DIR/STM32CubeF4 .. && cmake --build . run_tests: stage: test image: ${CI_DOCKER_REGISTRY}/qemu:esp-develop-20191124 tags: - build - internet script: - cd $CI_PROJECT_DIR/test - dd if=/dev/zero bs=1024 count=4096 of="empty_file.bin" # Run QEMU in backround (deamonized) - ${QEMU_PATH} -daemonize -machine esp32 -drive file=empty_file.bin,if=mtd,format=raw -global driver=esp32.gpio,property=strap_mode,value=0x0f -serial tcp::5555,server,nowait - cd $CI_PROJECT_DIR/test && mkdir build && cd build # Compile and run qemu tests - cmake .. -DQEMU_TEST=True && make && ./serial_flasher_test # Compile and run host tests - cmake .. -DQEMU_TEST=False && make && ./serial_flasher_test