Skip to content

Commit

Permalink
Merge branch 'feature/change_ci_building_process' into 'master'
Browse files Browse the repository at this point in the history
ci: Improve building process and save artifacts for ESP32 examples

See merge request espressif/esp-serial-flasher!114
  • Loading branch information
DNedic committed Sep 3, 2024
2 parents 2ac79d7 + fae6a2f commit 6cb0618
Show file tree
Hide file tree
Showing 8 changed files with 77 additions and 50 deletions.
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
build
build*/
sdkconfig
sdkconfig.old
empty_file.bin
binaries.c
*.lock
python_venv
managed_components
__pycache__
.pytest_cache
pytest_embedded_log
111 changes: 65 additions & 46 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,32 +23,6 @@ variables:
PI_PICO_SDK_REV: 1.5.1
PI_PICO_SDK: https://github.com/raspberrypi/pico-sdk


.build_idf_template:
stage: build
image: espressif/idf:latest
tags:
- build
- internet
variables:
PEDANTIC_FLAGS: "-Werror -Wall -Wextra"
EXTRA_CFLAGS: "${PEDANTIC_FLAGS}"
EXTRA_CXXFLAGS: "${PEDANTIC_FLAGS}"
script:
- cd $CI_PROJECT_DIR/examples/esp32_example
- idf.py build -DMD5_ENABLED=1
- idf.py build -DMD5_ENABLED=0
- cd $CI_PROJECT_DIR/examples/esp32_stub_example
- idf.py build
- cd $CI_PROJECT_DIR/examples/esp32_load_ram_example
- idf.py build
- cd $CI_PROJECT_DIR/examples/esp32_spi_load_ram_example
- idf.py build
- cd $CI_PROJECT_DIR/examples/esp32_get_target_info_example
- idf.py build
- cd $CI_PROJECT_DIR/examples/esp32_usb_cdc_acm_example
- idf.py build

run_pre_commit:
stage: pre_check
image: python:3.11-bookworm
Expand All @@ -70,54 +44,99 @@ check_stub_source_correctness:
- idf.py reconfigure -DSERIAL_FLASHER_STUB_PULL_VERSION='0.3.0'
- git diff --exit-code

# Special case as ESP-IDF v4.3 is not supported by the usb_host_cdc_acm component
# required by the USB CDC ACM interface port and its example
build_idf_v4.3:
.build_idf_template:
stage: build
tags:
- build
- internet
before_script:
- pip install -U idf-build-apps
variables:
PEDANTIC_FLAGS: "-Werror -Wall -Wextra"
EXTRA_CFLAGS: "${PEDANTIC_FLAGS}"
EXTRA_CXXFLAGS: "${PEDANTIC_FLAGS}"
BUILD_DIR: "build"
script:
- python -m idf_build_apps build -v -p .
--recursive
--exclude ./examples/binaries
--config "sdkconfig.defaults*"
--build-dir ${BUILD_DIR}
--check-warnings

build_idf_v4.3:
image: espressif/idf:release-v4.3
stage: build
tags:
- build
- internet
before_script:
- pip install -U idf-build-apps
variables:
PEDANTIC_FLAGS: "-Werror -Wall -Wextra"
EXTRA_CFLAGS: "${PEDANTIC_FLAGS}"
EXTRA_CXXFLAGS: "${PEDANTIC_FLAGS}"
BUILD_DIR: "build"
script:
- cd $CI_PROJECT_DIR/examples/esp32_example
- idf.py build -DMD5_ENABLED=1
- idf.py build -DMD5_ENABLED=0
- cd $CI_PROJECT_DIR/examples/esp32_stub_example
- idf.py build
- cd $CI_PROJECT_DIR/examples/esp32_load_ram_example
- idf.py build
- cd $CI_PROJECT_DIR/examples/esp32_spi_load_ram_example
- idf.py build
- cd $CI_PROJECT_DIR/examples/esp32_get_target_info_example
- idf.py build
- python -m idf_build_apps build -v -p .
--recursive
--exclude ./examples/binaries
--target "esp32"
--config "sdkconfig.defaults*"
--build-dir ${BUILD_DIR}
--check-warnings

build_idf_v4.4:
extends: .build_idf_template
image: espressif/idf:release-v4.4
extends: .build_idf_template

build_idf_v5.0:
extends: .build_idf_template
image: espressif/idf:release-v5.0
extends: .build_idf_template

build_idf_v5.1:
extends: .build_idf_template
image: espressif/idf:release-v5.1
extends: .build_idf_template

build_idf_v5.2:
extends: .build_idf_template
image: espressif/idf:release-v5.2
extends: .build_idf_template

build_idf_v5.3:
extends: .build_idf_template
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:
extends: .build_idf_template
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
Expand Down
1 change: 1 addition & 0 deletions examples/esp32_example/sdkconfig.defaults
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
CONFIG_IDF_TARGET="esp32"
CONFIG_PARTITION_TABLE_CUSTOM=y
3 changes: 3 additions & 0 deletions examples/esp32_example/sdkconfig.defaults.MD5_disabled
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
CONFIG_IDF_TARGET="esp32"
CONFIG_PARTITION_TABLE_CUSTOM=y
CONFIG_SERIAL_FLASHER_MD5_ENABLED=n
1 change: 1 addition & 0 deletions examples/esp32_get_target_info_example/sdkconfig.defaults
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
CONFIG_IDF_TARGET="esp32"
1 change: 1 addition & 0 deletions examples/esp32_load_ram_example/sdkconfig.defaults
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
CONFIG_IDF_TARGET="esp32"
4 changes: 1 addition & 3 deletions examples/esp32_spi_load_ram_example/sdkconfig.defaults
Original file line number Diff line number Diff line change
@@ -1,4 +1,2 @@
# This file was generated using idf.py save-defconfig. It can be edited manually.
# Espressif IoT Development Framework (ESP-IDF) Project Minimal Configuration
#
CONFIG_IDF_TARGET="esp32s3"
CONFIG_SERIAL_FLASHER_INTERFACE_SPI=y
1 change: 1 addition & 0 deletions examples/esp32_stub_example/sdkconfig.defaults
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
CONFIG_IDF_TARGET="esp32"
CONFIG_PARTITION_TABLE_CUSTOM=y

0 comments on commit 6cb0618

Please sign in to comment.