-
Notifications
You must be signed in to change notification settings - Fork 42
Expand file tree
/
Copy path.gitlab-ci.yml
More file actions
133 lines (121 loc) · 4 KB
/
Copy path.gitlab-ci.yml
File metadata and controls
133 lines (121 loc) · 4 KB
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
stages:
- build
- test
# Avoid running duplicate pipeline
workflow:
rules:
- if: '$CI_PIPELINE_SOURCE == "merge_request_event"'
- if: '$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH'
variables:
GIT_STRATEGY: fetch
GIT_SUBMODULE_STRATEGY: recursive
before_script:
- mkdir -p ~/.ssh
- chmod 700 ~/.ssh
- echo -n $GITLAB_KEY_TMP > ~/.ssh/id_rsa_base64
- base64 --decode --ignore-garbage ~/.ssh/id_rsa_base64 > ~/.ssh/id_rsa
- chmod 600 ~/.ssh/id_rsa
- echo -e "Host gitlab.espressif.cn\n\tStrictHostKeyChecking no\n" >> ~/.ssh/config
- |
if [ -n "$IDF_COMPONENT_MGR_VER" ]; then
pip install idf-component-manager==$IDF_COMPONENT_MGR_VER
fi
.test_build: &test_build
# Build examples
- for TARGET in $EXAMPLE_TARGETS; do
- idf.py $IDF_EXTRA_FLAGS set-target $TARGET build
# set-target wipes the build dir, so merge before the next target
- ${CI_PROJECT_DIR}/tools/ci/stage_merged_bin.sh $TARGET
- done
.build_template:
stage: build
image: espressif/idf:latest
tags:
- build
variables:
PEDANTIC_FLAGS: "-Werror -Wno-error=cpp -Werror=unused-variable -Werror=unused-but-set-variable -Werror=unused-function"
EXTRA_CFLAGS: "${PEDANTIC_FLAGS}"
EXTRA_CXXFLAGS: "${PEDANTIC_FLAGS}"
rules:
- if: '$CI_PIPELINE_SOURCE == "schedule"'
when: never
- when: on_success
script:
- cd ${CI_PROJECT_DIR}/test_app
# build examples
- *test_build
- cd ${CI_PROJECT_DIR}
artifacts:
expire_in: 1 day
paths:
- test_app/ci_bins/
# esp-nn is small and builds fast, so exercise the full target set on every IDF
# generation. This keeps the ESP32-S3 and ESP32-P4 PIE assembly building across
# old and new toolchains, whose assemblers differ.
build_idf_master:
extends: .build_template
image: espressif/idf:latest
variables:
EXAMPLE_TARGETS: esp32 esp32s3 esp32c3 esp32c5 esp32p4 esp32s31
# esp32s31 is a preview target on IDF master
IDF_EXTRA_FLAGS: "--preview"
build_idf_v6.0:
extends: .build_template
image: espressif/idf:release-v6.0
variables:
EXAMPLE_TARGETS: esp32 esp32s2 esp32s3 esp32c2 esp32c3 esp32c6 esp32c5 esp32h2 esp32p4
build_idf_v5.5:
extends: .build_template
image: espressif/idf:release-v5.5
variables:
EXAMPLE_TARGETS: esp32 esp32s2 esp32s3 esp32c2 esp32c3 esp32c6 esp32c5 esp32h2 esp32p4
build_idf_v5.4:
extends: .build_template
image: espressif/idf:release-v5.4
variables:
EXAMPLE_TARGETS: esp32 esp32s2 esp32s3 esp32c2 esp32c3 esp32c6 esp32h2 esp32p4
build_idf_v5.3:
extends: .build_template
image: espressif/idf:release-v5.3
variables:
EXAMPLE_TARGETS: esp32 esp32s2 esp32s3 esp32c2 esp32c3 esp32c6 esp32h2 esp32p4
build_idf_v5.2:
extends: .build_template
image: espressif/idf:release-v5.2
variables:
EXAMPLE_TARGETS: esp32 esp32s2 esp32s3 esp32c2 esp32c3 esp32c6 esp32h2
build_idf_v5.1:
extends: .build_template
image: espressif/idf:release-v5.1
variables:
EXAMPLE_TARGETS: esp32 esp32s2 esp32s3 esp32c2 esp32c3 esp32c6 esp32h2
# esp-emu 0.41 models esp32c3/c5/c6/h2/p4/s31; the other targets (incl. the
# RISC-V esp32c2) stay build-only. The verdict is the app's TEST_RESULT line.
emulate_tests:
stage: test
# Must be a glibc image, esp-emulator ships no musl build.
image: python:3.13 # not -slim: the runner's instance pre-build hook needs wget
tags:
- build
variables:
ESP_EMU_VERSION: "0.41.0"
EMU_TIMEOUT: "600"
DEBIAN_FRONTEND: noninteractive
# 23+ emulated runs of up to EMU_TIMEOUT each, four at a time.
timeout: 2h
rules:
- if: '$CI_PIPELINE_SOURCE == "schedule"'
when: never
- when: on_success
script:
- curl -fsSL https://raw.githubusercontent.com/espressif/esp-emulator/main/install.sh
| sh -s -- --version ${ESP_EMU_VERSION} --bin-dir /usr/local/bin --quiet
- python3 tools/ci/run_emulator_tests.py
--bins-dir test_app/ci_bins
--out-dir test_results
--timeout ${EMU_TIMEOUT}
artifacts:
when: always
expire_in: 1 week
paths:
- test_results/