Skip to content

Commit 0c5baeb

Browse files
Tinyu-Zhaolbuque
authored andcommitted
.gitlab-ci.yml: Fix GitLab CI build documentation error.
Signed-off-by: [email protected] <[email protected]>
1 parent 90a4e82 commit 0c5baeb

File tree

2 files changed

+29
-11
lines changed

2 files changed

+29
-11
lines changed

.gitlab-ci.yml

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,15 @@
1+
workflow:
2+
auto_cancel:
3+
on_new_commit: conservative # the default behavior
4+
15
variables:
26
DEBIAN_FRONTEND: noninteractive
37
ESP_IDF_SRC_DIR: $CI_PROJECT_DIR/esp-idf
48

59
cache:
610
key: "$CI_PROJECT_ID-esp-idf-v542"
711
paths:
8-
- $ESP_IDF_SRC_DIR
12+
- ${ESP_IDF_SRC_DIR}
913
policy: pull-push
1014
when: on_success
1115

@@ -18,6 +22,7 @@ stages:
1822

1923
code-format:
2024
stage: code_format
25+
interruptible: true
2126
before_script:
2227
- export PATH="$HOME/.local/bin:$PATH"
2328
script:
@@ -26,15 +31,16 @@ code-format:
2631
- source tools/ci.sh && ci_code_formatting_run
2732
- git diff --exit-code
2833
tags:
29-
- uiflow-firmware
34+
- uiflow-docs
3035

3136

3237
build-job:
3338
stage: build
39+
interruptible: true
3440
script:
3541
- sudo apt-get update -qy
36-
- sudo apt-get install git wget flex bison gperf quilt python3 python3-pip python3-venv cmake ninja-build ccache libffi-dev libssl-dev dfu-util libusb-1.0-0 -y
37-
- source tools/ci.sh && ci_esp32_idf541_setup
42+
- sudo apt-get install git wget flex bison gperf quilt python3 python3-pip python3-venv cmake ninja-build ccache libffi-dev libssl-dev dfu-util libusb-1.0-0 locales -y
43+
- source tools/ci.sh && ci_esp32_idf542_setup
3844
- source tools/ci.sh && ci_esp32_nightly_build
3945
artifacts:
4046
paths:
@@ -46,6 +52,7 @@ build-job:
4652

4753
build-docs:
4854
stage: docs
55+
interruptible: true
4956
script:
5057
- echo "Building the documentation..."
5158
- cd docs
@@ -59,7 +66,7 @@ build-docs:
5966
paths:
6067
- docs/build/
6168
tags:
62-
- uiflow-firmware
69+
- uiflow-docs
6370

6471

6572
release_job:

tools/ci.sh

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,10 @@ function uncrustify_setup {
2222
wget https://github.com/uncrustify/uncrustify/archive/refs/tags/uncrustify-0.72.0.tar.gz
2323
tar -xvf uncrustify-0.72.0.tar.gz
2424
cd uncrustify-uncrustify-0.72.0
25+
chmod +x ./scripts/make_option_enum.py
26+
sed -i -e '1s@.*@cmake_minimum_required(VERSION 3.5...4.1)@' \
27+
-e '20s@.*@find_package(Python3 COMPONENTS Interpreter REQUIRED)@' ./CMakeLists.txt
28+
sed -i '1s@.*@cmake_minimum_required(VERSION 3.5...4.1)@' ./tests/CMakeLists.txt
2529
mkdir build
2630
cd build
2731
cmake -DCMAKE_BUILD_TYPE=Release ..
@@ -159,26 +163,26 @@ function ci_esp32_idf522_setup {
159163
rm -rf esp-idf
160164
fi
161165
fi
162-
166+
echo "Cloning esp-idf v5.2.2..."
163167
git clone --depth 1 --branch v5.2.2 https://github.com/espressif/esp-idf.git
164-
git -C esp-idf submodule update --init \
168+
git -C esp-idf submodule update --init --depth 1 \
165169
components/bt/host/nimble/nimble \
166170
components/esp_wifi \
167171
components/esptool_py/esptool \
168172
components/lwip/lwip \
169173
components/mbedtls/mbedtls
170174
if [ -d esp-idf/components/bt/controller/esp32 ]; then
171-
git -C esp-idf submodule update --init \
175+
git -C esp-idf submodule update --init --depth 1 \
172176
components/bt/controller/lib_esp32 \
173177
components/bt/controller/lib_esp32c3_family
174178
else
175-
git -C esp-idf submodule update --init \
179+
git -C esp-idf submodule update --init --depth 1 \
176180
components/bt/controller/lib
177181
fi
178182
./esp-idf/install.sh
179183
}
180184

181-
function ci_esp32_idf541_setup {
185+
function ci_esp32_idf542_setup {
182186
if [ -d esp-idf ]; then
183187
echo "esp-idf is already cloned."
184188
if [ "$(git -C esp-idf describe --tags)" == "v5.4.2" ]; then
@@ -191,7 +195,7 @@ function ci_esp32_idf541_setup {
191195
fi
192196

193197
git clone --depth 1 --branch v5.4.2 https://github.com/espressif/esp-idf.git
194-
git -C esp-idf submodule update --init
198+
git -C esp-idf submodule update --init --depth 1
195199
./esp-idf/install.sh
196200
}
197201

@@ -312,6 +316,13 @@ function ci_hat_build {
312316

313317

314318
function ci_esp32_nightly_build {
319+
REQUIRED_VERSION="3.28.3"
320+
CURRENT_VERSION=$(cmake --version | head -n1 | awk '{print $3}')
321+
322+
if [ "$(printf '%s\n' "$REQUIRED_VERSION" "$CURRENT_VERSION" | sort -V | head -n1)" != "$REQUIRED_VERSION" ]; then
323+
echo "❌ CMake version $CURRENT_VERSION is too old! Require >= $REQUIRED_VERSION"
324+
exit 1
325+
fi
315326
source esp-idf/export.sh
316327
pip install future
317328
make ${MAKEOPTS} -C m5stack unpatch

0 commit comments

Comments
 (0)