forked from espressif/esp-serial-flasher
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.gitlab-ci.yml
166 lines (152 loc) · 5.32 KB
/
.gitlab-ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
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: v3.5.0
ZEPHYR_TOOLCHAIN: https://github.com/zephyrproject-rtos/sdk-ng/releases/download/v0.16.3/toolchain_linux-x86_64_xtensa-espressif_esp32_zephyr-elf.tar.xz
ZEPHYR_SDK: https://github.com/zephyrproject-rtos/sdk-ng/releases/download/v0.16.3/zephyr-sdk-0.16.3_linux-aarch64_minimal.tar.xz
.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_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_usb_cdc_acm_example
- idf.py build
run_pre_commit:
stage: pre_check
image: python:3.11-bookworm
tags:
- internet
script:
- apt-get update
- pip install pre-commit
- pre-commit run --show-diff-on-failure --from-ref origin/master --to-ref HEAD
# 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:
stage: build
image: espressif/idf:release-v4.3
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_load_ram_example
- idf.py build
- cd $CI_PROJECT_DIR/examples/esp32_spi_load_ram_example
- idf.py build
build_idf_v4.4:
extends: .build_idf_template
image: espressif/idf:release-v4.4
build_idf_v5.0:
extends: .build_idf_template
image: espressif/idf:release-v5.0
build_idf_v5.1:
extends: .build_idf_template
image: espressif/idf:release-v5.1
build_idf_master:
extends: .build_idf_template
image: espressif/idf:latest
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
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 $CI_PROJECT_DIR/examples/zephyr_example -DZEPHYR_EXTRA_MODULES=$CI_PROJECT_DIR
run_tests:
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_test.sh qemu
- ./run_test.sh host
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
- python -m idf_component_manager upload-component --allow-existing --name=esp-serial-flasher --namespace=espressif