Skip to content

Commit 27aeba2

Browse files
committed
tools/ci.sh: Repair environment installation failure.
Signed-off-by: lbuque <[email protected]>
1 parent 417c76f commit 27aeba2

File tree

4 files changed

+98
-23
lines changed

4 files changed

+98
-23
lines changed

.gitlab-ci.yml

Lines changed: 28 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,16 @@ cache:
1010

1111
stages:
1212
- code_format
13-
- build
13+
- build_quick
1414
- docs
15+
- build
1516
- release
1617

1718

1819
code-format:
1920
stage: code_format
21+
before_script:
22+
- export PATH="$HOME/.local/bin:$PATH"
2023
script:
2124
- source tools/ci.sh && ci_code_formatting_setup
2225
- source tools/ci.sh && ci_code_formatting_run
@@ -29,13 +32,13 @@ code-format:
2932
- "tests/**"
3033
- "third-party/**"
3134

32-
build-job:
33-
stage: build
35+
build-quick-job:
36+
stage: build_quick
3437
script:
3538
- sudo apt-get update -qy
3639
- sudo apt-get install git wget flex bison gperf python3 python3-pip python3-venv cmake ninja-build ccache libffi-dev libssl-dev dfu-util libusb-1.0-0 -y
3740
- source tools/ci.sh && ci_esp32_idf522_setup
38-
- source tools/ci.sh && ci_esp32_nightly_build
41+
- source tools/ci.sh && ci_esp32_quick_build
3942
artifacts:
4043
paths:
4144
- m5stack/build-*/uiflow-*-*.bin
@@ -49,6 +52,27 @@ build-job:
4952
- "third-party/**"
5053

5154

55+
build-job:
56+
stage: build
57+
script:
58+
- sudo apt-get update -qy
59+
- sudo apt-get install git wget flex bison gperf python3 python3-pip python3-venv cmake ninja-build ccache libffi-dev libssl-dev dfu-util libusb-1.0-0 -y
60+
- source tools/ci.sh && ci_esp32_idf522_setup
61+
- source tools/ci.sh && ci_esp32_nightly_build
62+
artifacts:
63+
paths:
64+
- m5stack/build-*/uiflow-*-*.bin
65+
- third-party/build-*/uiflow-*-*.bin
66+
tags:
67+
- uiflow-firmware
68+
only:
69+
refs:
70+
- tags
71+
variables:
72+
- $CI_COMMIT_TAG =~ /^release\/[0-9]+\.[0-9]+\.[0-9]+$/
73+
- $CI_COMMIT_REF_SLUG == "develop_m5things"
74+
75+
5276
build-docs:
5377
stage: docs
5478
script:

examples/unit/ncir2/m5cores3_ncir2_base_example.py

Lines changed: 37 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
import time
1212

1313

14-
1514
title0 = None
1615
label_temp = None
1716
label_la = None
@@ -25,16 +24,30 @@
2524

2625

2726
def setup():
28-
global title0, label_temp, label_la, label_ha, label_temp_val, label_la_val, label_ha_val, i2c0, ncir2_0, last_time
27+
global \
28+
title0, \
29+
label_temp, \
30+
label_la, \
31+
label_ha, \
32+
label_temp_val, \
33+
label_la_val, \
34+
label_ha_val, \
35+
i2c0, \
36+
ncir2_0, \
37+
last_time
2938
M5.begin()
3039
Widgets.fillScreen(0x222222)
31-
title0 = Widgets.Title("Temperature meassure", 3, 0xffffff, 0x0000FF, Widgets.FONTS.DejaVu24)
32-
label_temp = Widgets.Label("Temp: ", 10, 116, 1.0, 0xffffff, 0x222222, Widgets.FONTS.DejaVu24)
33-
label_la = Widgets.Label("low temp alarm value: ", 10, 50, 1.0, 0x0000ff, 0x222222, Widgets.FONTS.DejaVu18)
34-
label_ha = Widgets.Label("high temp alarm value: ", 10, 80, 1.0, 0xff0000, 0x222222, Widgets.FONTS.DejaVu18)
35-
label_temp_val = Widgets.Label(" ", 95, 116, 1.0, 0xffffff, 0x222222, Widgets.FONTS.DejaVu24)
36-
label_la_val = Widgets.Label(" ", 232, 50, 1.0, 0x0000ff, 0x222222, Widgets.FONTS.DejaVu18)
37-
label_ha_val = Widgets.Label(" ", 239, 80, 1.0, 0xff0000, 0x222222, Widgets.FONTS.DejaVu18)
40+
title0 = Widgets.Title("Temperature meassure", 3, 0xFFFFFF, 0x0000FF, Widgets.FONTS.DejaVu24)
41+
label_temp = Widgets.Label("Temp: ", 10, 116, 1.0, 0xFFFFFF, 0x222222, Widgets.FONTS.DejaVu24)
42+
label_la = Widgets.Label(
43+
"low temp alarm value: ", 10, 50, 1.0, 0x0000FF, 0x222222, Widgets.FONTS.DejaVu18
44+
)
45+
label_ha = Widgets.Label(
46+
"high temp alarm value: ", 10, 80, 1.0, 0xFF0000, 0x222222, Widgets.FONTS.DejaVu18
47+
)
48+
label_temp_val = Widgets.Label(" ", 95, 116, 1.0, 0xFFFFFF, 0x222222, Widgets.FONTS.DejaVu24)
49+
label_la_val = Widgets.Label(" ", 232, 50, 1.0, 0x0000FF, 0x222222, Widgets.FONTS.DejaVu18)
50+
label_ha_val = Widgets.Label(" ", 239, 80, 1.0, 0xFF0000, 0x222222, Widgets.FONTS.DejaVu18)
3851

3952
i2c0 = I2C(0, scl=Pin(1), sda=Pin(2), freq=100000)
4053
ncir2_0 = NCIR2Unit(i2c0, 0x5A)
@@ -44,21 +57,32 @@ def setup():
4457

4558

4659
def loop():
47-
global title0, label_temp, label_la, label_ha, label_temp_val, label_la_val, label_ha_val, i2c0, ncir2_0, last_time
60+
global \
61+
title0, \
62+
label_temp, \
63+
label_la, \
64+
label_ha, \
65+
label_temp_val, \
66+
label_la_val, \
67+
label_ha_val, \
68+
i2c0, \
69+
ncir2_0, \
70+
last_time
4871
M5.update()
4972
if (time.ticks_diff((time.ticks_ms()), last_time)) > 500:
5073
last_time = time.ticks_ms()
51-
label_temp.setText(str((str((ncir2_0.get_temperature_value)) + str(' C'))))
74+
label_temp.setText(str((str((ncir2_0.get_temperature_value)) + str(" C"))))
5275

5376

54-
if __name__ == '__main__':
77+
if __name__ == "__main__":
5578
try:
5679
setup()
5780
while True:
5881
loop()
5982
except (Exception, KeyboardInterrupt) as e:
6083
try:
61-
from utility import print_error_msg
84+
from utility import print_error_msg
85+
6286
print_error_msg(e)
6387
except ImportError:
6488
print("please update to latest firmware")

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,4 +43,4 @@ max-complexity = 40
4343
"m5stack/modules/tiny_gui/**.py" = ["F821"]
4444

4545
[tool.ruff.format]
46-
exclude = ["docs/**/*.py", "micropython/**/*.py", "tools/**/*.py"]
46+
exclude = ["docs/**/*.py", "esp-adf/**/*.py", "esp-idf/**/*.py", "m5stack/cmodules/lv_binding_micropython/**/*.py", "m5stack/cmodules/lv_binding_micropython/**/*.pyi", "m5stack/components/**/*.py", "micropython/**/*.py", "tools/**/*.py"]

tools/ci.sh

Lines changed: 32 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,16 +17,21 @@ function ci_code_formatting_setup {
1717
sudo apt-add-repository --yes ppa:pybricks/ppa
1818
sudo apt update
1919
sudo apt-get install uncrustify
20-
pip3 install black
21-
pip3 install micropython-typesheds
22-
pip3 install ruff==0.3.0
23-
pip3 install codespell==2.2.6 tomli==2.0.1
24-
pip3 install pre-commit==3.6.2
20+
sudo apt install pipx
21+
pipx install uv
22+
uv venv
23+
source .venv/bin/activate
24+
uv pip install black
25+
uv pip install micropython-typesheds
26+
uv pip install ruff==0.3.0
27+
uv pip install codespell==2.2.6 tomli==2.0.1
28+
uv pip install pre-commit==3.6.2
2529
uncrustify --version
2630
black --version
2731
}
2832

2933
function ci_code_formatting_run {
34+
source .venv/bin/activate
3035
tools/codeformat.py -v
3136
}
3237

@@ -189,6 +194,28 @@ function ci_esp32_build {
189194
fi
190195
}
191196

197+
function ci_esp32_quick_build {
198+
source esp-idf/export.sh
199+
pip install future
200+
make ${MAKEOPTS} -C m5stack unpatch
201+
make ${MAKEOPTS} -C m5stack submodules
202+
make ${MAKEOPTS} -C m5stack patch
203+
make ${MAKEOPTS} -C m5stack littlefs
204+
make ${MAKEOPTS} -C m5stack mpy-cross
205+
make ${MAKEOPTS} -C m5stack BOARD=M5STACK_AirQ pack_all
206+
make ${MAKEOPTS} -C m5stack BOARD=M5STACK_Atom_Lite pack_all
207+
make ${MAKEOPTS} -C m5stack BOARD=M5STACK_AtomS3 pack_all
208+
make ${MAKEOPTS} -C m5stack BOARD=M5STACK_Basic pack_all
209+
make ${MAKEOPTS} -C m5stack BOARD=M5STACK_Basic_4MB pack_all
210+
make ${MAKEOPTS} -C m5stack BOARD=M5STACK_Core2 pack_all
211+
make ${MAKEOPTS} -C m5stack BOARD=M5STACK_CoreInk pack_all
212+
make ${MAKEOPTS} -C m5stack BOARD=M5STACK_CoreS3 pack_all
213+
make ${MAKEOPTS} -C m5stack BOARD=M5STACK_NanoC6 pack_all
214+
make ${MAKEOPTS} -C m5stack BOARD=M5STACK_Stamp_PICO pack_all
215+
make ${MAKEOPTS} -C m5stack BOARD=M5STACK_StickC pack_all
216+
make ${MAKEOPTS} -C third-party BOARD=SEEED_STUDIO_XIAO_ESP32S3 pack_all
217+
}
218+
192219
function ci_esp32_nightly_build {
193220
source esp-idf/export.sh
194221
pip install future

0 commit comments

Comments
 (0)