代码拉取完成,页面将自动刷新
stages:
- pre_check
- build
- test
- deploy
workflow:
rules:
- if: '$CI_PIPELINE_SOURCE == "merge_request_event"'
- if: $CI_COMMIT_BRANCH && $CI_OPEN_MERGE_REQUESTS && $CI_PIPELINE_SOURCE == "push"
when: never
- if: "$CI_COMMIT_BRANCH"
variables:
STM32_CUBE_H7_REPO: https://github.com/STMicroelectronics/STM32CubeH7
STM32_CUBE_H7_REPO_TAG: v1.11.1
ARM_TOOLCHAIN_URL: https://developer.arm.com/-/media/Files/downloads/gnu/13.2.rel1/binrel/arm-gnu-toolchain-13.2.rel1-x86_64-arm-none-eabi.tar.xz?rev=e434b9ea4afc4ed7998329566b764309&hash=CA590209F5774EE1C96E6450E14A3E26
QEMU_PATH: /opt/qemu/bin/qemu-system-xtensa
ZEPHYR_REPO: https://github.com/zephyrproject-rtos/zephyr.git
ZEPHYR_REPO_REV: v4.0.0
ZEPHYR_TOOLCHAIN: https://github.com/zephyrproject-rtos/sdk-ng/releases/download/v0.17.0/toolchain_linux-x86_64_xtensa-espressif_esp32_zephyr-elf.tar.xz
ZEPHYR_SDK: https://github.com/zephyrproject-rtos/sdk-ng/releases/download/v0.17.0/zephyr-sdk-0.17.0_linux-aarch64_minimal.tar.xz
PI_PICO_SDK_REV: 1.5.1
PI_PICO_SDK: https://github.com/raspberrypi/pico-sdk
PIP_CACHE_DIR: "$CI_PROJECT_DIR/.cache/pip"
PIP_EXTRA_INDEX_URL: "https://dl.espressif.com/pypi"
cache:
paths:
- "$CI_PROJECT_DIR/.cache/pip"
run_pre_commit:
stage: pre_check
image: python:3.11-bookworm
tags:
- internet
script:
- apt-get update
- pip install pre-commit
- git fetch origin master
- pre-commit run --show-diff-on-failure --from-ref origin/master --to-ref HEAD
check_stub_source_correctness:
stage: pre_check
image: espressif/idf:v5.2.2
tags:
- internet
script:
- cd $CI_PROJECT_DIR/examples/esp32_stub_example
- idf.py reconfigure -DSERIAL_FLASHER_STUB_PULL_VERSION='0.3.0'
- git diff --exit-code
.build_idf_template:
stage: build
tags:
- build
- internet
before_script:
- apt install ccache
- pip install -U idf-build-apps --prefer-binary
variables:
IDF_CCACHE_ENABLE: 1
CCACHE_DIR: "/cache/esf_ccache"
CCACHE_SLOPPINESS: "time_macros"
PEDANTIC_FLAGS: "-Werror -Wall -Wextra"
EXTRA_CFLAGS: "${PEDANTIC_FLAGS}"
EXTRA_CXXFLAGS: "${PEDANTIC_FLAGS}"
BUILD_DIR: "build"
script:
# CCACHE_RECACHE Used when invalidating the current cache.
# could be enabled by MR label "ccache:recache"
- |
if [ -n "${CI_MERGE_REQUEST_LABELS}" ] && echo "${CI_MERGE_REQUEST_LABELS}" | grep -q "ccache::recache"; then
export CCACHE_RECACHE="1"
echo "INFO: ccache recache enabled"
fi
- python -m idf_build_apps build -v -p .
--recursive
--exclude ./examples/binaries
--config "sdkconfig.defaults*"
--build-dir ${BUILD_DIR}
--check-warnings
# Show ccache statistics if enabled globally
- test "$CI_CCACHE_STATS" == 1 && test -n "$(which ccache)" && ccache --show-stats -vv || true
build_idf_v4.3:
image: espressif/idf:release-v4.3
stage: build
tags:
- build
- internet
before_script:
- apt install ccache
- pip install -U idf-build-apps --prefer-binary
variables:
IDF_CCACHE_ENABLE: 1
CCACHE_DIR: "/cache/esf_ccache"
CCACHE_SLOPPINESS: "time_macros"
PEDANTIC_FLAGS: "-Werror -Wall -Wextra"
EXTRA_CFLAGS: "${PEDANTIC_FLAGS}"
EXTRA_CXXFLAGS: "${PEDANTIC_FLAGS}"
BUILD_DIR: "build"
script:
# CCACHE_RECACHE Used when invalidating the current cache.
# could be enabled by MR label "ccache:recache"
- |
if [ -n "${CI_MERGE_REQUEST_LABELS}" ] && echo "${CI_MERGE_REQUEST_LABELS}" | grep -q "ccache::recache"; then
export CCACHE_RECACHE="1"
echo "INFO: ccache recache enabled"
fi
- python -m idf_build_apps build -v -p .
--recursive
--exclude ./examples/binaries
--target "esp32"
--config "sdkconfig.defaults*"
--build-dir ${BUILD_DIR}
--check-warnings
# Show ccache statistics if enabled globally
- test "$CI_CCACHE_STATS" == 1 && test -n "$(which ccache)" && ccache --show-stats -vv || true
build_idf_v4.4:
image: espressif/idf:release-v4.4
extends: .build_idf_template
build_idf_v5.0:
image: espressif/idf:release-v5.0
extends: .build_idf_template
build_idf_v5.1:
image: espressif/idf:release-v5.1
extends: .build_idf_template
build_idf_v5.2:
image: espressif/idf:release-v5.2
extends: .build_idf_template
build_idf_v5.3:
image: espressif/idf:release-v5.3
variables:
BUILD_DIR: "build_stable"
artifacts:
paths:
- "**/build*/*.bin"
- "**/build*/*.elf"
- "**/build*/*.map"
- "**/build*/flasher_args.json"
- "**/build*/flash_project_args"
- "**/build*/config/sdkconfig.json"
- "**/build*/bootloader/*.bin"
- "**/build*/partition_table/*.bin"
when: always
expire_in: 3 days
extends: .build_idf_template
build_idf_master:
image: espressif/idf:latest
variables:
BUILD_DIR: "build_master"
artifacts:
paths:
- "**/build*/*.bin"
- "**/build*/*.elf"
- "**/build*/*.map"
- "**/build*/flasher_args.json"
- "**/build*/flash_project_args"
- "**/build*/config/sdkconfig.json"
- "**/build*/bootloader/*.bin"
- "**/build*/partition_table/*.bin"
when: always
expire_in: 3 days
extends: .build_idf_template
build_stm32:
stage: build
# IDF is not necessary for STM32 build, but this image is already used in another job
# and it comes with a recent enough CMake version.
image: espressif/idf:latest
artifacts:
paths:
- "**/build*/*.bin"
when: always
expire_in: 3 days
tags:
- build
- internet
script:
- cd $CI_PROJECT_DIR
- git submodule update --init
- git clone --depth=1 -b ${STM32_CUBE_H7_REPO_TAG} ${STM32_CUBE_H7_REPO}
- wget --no-verbose -O gcc-arm-none-eabi.tar.xz ${ARM_TOOLCHAIN_URL}
- tar xf gcc-arm-none-eabi.tar.xz
- mv arm-gnu-toolchain-* gcc-arm-none-eabi
- mkdir $CI_PROJECT_DIR/examples/stm32_example/build
- cd $CI_PROJECT_DIR/examples/stm32_example/build
- cmake -DSTM32_TOOLCHAIN_PATH=$CI_PROJECT_DIR/gcc-arm-none-eabi -DSTM32_CUBE_H7_PATH=$CI_PROJECT_DIR/STM32CubeH7 -G Ninja ..
- cmake --build .
build_zephyr:
stage: build
image: espressif/idf:latest
tags:
- build
- internet
script:
- mkdir $CI_PROJECT_DIR/zephyrproject-rtos
- cd $CI_PROJECT_DIR/zephyrproject-rtos
- git clone --single-branch --depth=1 -b ${ZEPHYR_REPO_REV} ${ZEPHYR_REPO}
- mkdir $CI_PROJECT_DIR/zephyrproject-rtos/zephyr-sdk
- cd $CI_PROJECT_DIR/zephyrproject-rtos/zephyr-sdk
- wget --no-verbose -O zephyr_sdk.tar.xz ${ZEPHYR_SDK}
- tar xvf zephyr_sdk.tar.xz --strip-components=1
- wget --no-verbose -O esp32_toolchain.tar.xz ${ZEPHYR_TOOLCHAIN}
- tar xvf esp32_toolchain.tar.xz
- export ZEPHYR_SDK_INSTALL_DIR=$(pwd)
- export ZEPHYR_TOOLCHAIN_VARIANT="zephyr"
- cd $CI_PROJECT_DIR/zephyrproject-rtos/zephyr
- export ZEPHYR_BASE=$(pwd)
- pip install -r scripts/requirements.txt
- pip install wheel
- if [[ ! -d "$CI_PROJECT_DIR/zephyrproject-rtos/.west" ]]; then
- west init -l .
- fi
- unset IDF_PATH
- west zephyr-export
- west update hal_espressif
- west build -p -b esp32_devkitc_wroom/esp32/procpu $CI_PROJECT_DIR/examples/zephyr_example -DZEPHYR_EXTRA_MODULES=$CI_PROJECT_DIR
build_pi_pico:
stage: build
image: espressif/idf:latest
tags:
- build
- internet
artifacts:
paths:
- "**/build*/*.bin"
- "**/build*/*.elf"
- "**/build*/*.uf2"
when: always
expire_in: 3 days
script:
- git clone --recursive --single-branch --depth=1 -b ${PI_PICO_SDK_REV} ${PI_PICO_SDK}
- export PICO_SDK_PATH=$(pwd)/pico-sdk
- wget --no-verbose -O gcc-arm-none-eabi.tar.xz ${ARM_TOOLCHAIN_URL}
- tar xf gcc-arm-none-eabi.tar.xz
- mv arm-gnu-toolchain-* gcc-arm-none-eabi
- export PATH="$(pwd)/gcc-arm-none-eabi/bin:$PATH"
- cd $CI_PROJECT_DIR/examples/pi_pico_example
- mkdir build
- cd build
- cmake ..
- cmake --build .
build_pi:
stage: build
image: dtcooper/raspberrypi-os:latest
tags:
- ESF-RPI-01
before_script:
- apt-get update
- apt-get install -y cmake gcc g++ make pigpio
script:
- cd $CI_PROJECT_DIR/examples/raspberry_example
- mkdir build && cd build
- cmake .. && cmake --build .
artifacts:
paths:
- "${CI_PROJECT_DIR}/examples/raspberry_example/build/raspberry_flasher"
when: always
expire_in: 3 days
test_qemu:
stage: test
image: ${CI_DOCKER_REGISTRY}/qemu:esp-develop-20191124
tags:
- build
- internet
script:
- cd $CI_PROJECT_DIR/test
- export QEMU_PATH=/opt/qemu/bin/qemu-system-xtensa
- ./run_qemu_test.sh
.test_template:
stage: test
image: debian:latest
before_script:
- apt-get update
- apt-get install -y python3 python3-pip libffi-dev
- pip install -r $CI_PROJECT_DIR/test/requirements_test.txt --break-system-packages --prefer-binary
- pip install esptool --break-system-packages --prefer-binary
artifacts:
paths:
- "${CI_PROJECT_DIR}/examples/pytest_embedded_log/"
when: always
expire_in: 1 week
test_esp1:
extends: .test_template
tags:
- ESF-RPI-02
parallel:
matrix:
- CI_BUILD_FOLDER:
- "build_stable"
- "build_master"
script:
- cd $CI_PROJECT_DIR
- pytest --target=esp32s3 --port=/dev/serial_ports/ESP32S3_ESP32C3 -k 'not test_esp32_spi_load_ram_example'
- pytest --target=esp32 --port=/dev/serial_ports/ESP32_ESP32C6 -k 'test_esp32_sdio_load_ram_example'
test_esp2:
extends: .test_template
tags:
- ESF-RPI-01
parallel:
matrix:
- CI_BUILD_FOLDER:
- "build_stable"
- "build_master"
script:
- cd $CI_PROJECT_DIR
- pytest --target=esp32 --port=/dev/serial_ports/ESP32_ESP32 -k 'not test_esp32_sdio_load_ram_example'
- pytest --target=esp32s3 --port=/dev/serial_ports/ESP32S3_ESP32C3 -k 'not test_esp32_usb_cdc_acm_example'
test_stm32:
extends: .test_template
tags:
- ESF-RPI-03
script:
- pytest --target=stm32 --port=/dev/serial_ports/STM32_ESP32
test_pi_pico:
extends: .test_template
tags:
- ESF-RPI-03
script:
- pytest --target=pi_pico --port=/dev/serial_ports/pico_ESP32
test_rpi:
stage: test
image: dtcooper/raspberrypi-os:latest
tags:
- ESF-RPI-01
before_script:
- apt-get update
- apt-get install -y pigpio python3 python3-pip libffi-dev
- pip install -r $CI_PROJECT_DIR/test/requirements_test.txt --break-system-packages --prefer-binary
script:
- pytest --target=raspberry
push_to_the_components_registry:
stage: deploy
image: python:3.11-bookworm
tags:
- build
- internet
rules:
- if: '$CI_COMMIT_BRANCH == "master"'
- if: '$FORCE_PUSH_COMPONENT == "1"'
script:
- pip install idf-component-manager
- compote component upload --allow-existing --name=esp-serial-flasher --namespace=espressif
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。