Skip to content

Commit 7ada32c

Browse files
committed
ci: apply idf-ci for artifacts
1 parent 15b4112 commit 7ada32c

File tree

22 files changed

+287
-707
lines changed

22 files changed

+287
-707
lines changed

.gitlab/ci/README.md

Lines changed: 1 addition & 69 deletions
Original file line numberDiff line numberDiff line change
@@ -255,72 +255,4 @@ In ESP-IDF CI, there's a few more special rules are additionally supported to di
255255

256256
## Upload/Download Artifacts to Internal Minio Server
257257

258-
### Users Without Access to Minio
259-
260-
If you don't have access to the internal Minio server, you can still download the artifacts from the shared link in the job log.
261-
262-
The log will look like this:
263-
264-
```shell
265-
Pipeline ID : 587355
266-
Job name : build_clang_test_apps_esp32
267-
Job ID : 40272275
268-
Created archive file: 40272275.zip, uploading as 587355/build_dir_without_map_and_elf_files/build_clang_test_apps_esp32/40272275.zip
269-
Please download the archive file includes build_dir_without_map_and_elf_files from [INTERNAL_URL]
270-
```
271-
272-
### Users With Access to Minio
273-
274-
#### Env Vars for Minio
275-
276-
Minio takes these env vars to connect to the server:
277-
278-
- `IDF_S3_SERVER`
279-
- `IDF_S3_ACCESS_KEY`
280-
- `IDF_S3_SECRET_KEY`
281-
- `IDF_S3_BUCKET`
282-
283-
#### Artifacts Types and File Patterns
284-
285-
The artifacts types and corresponding file patterns are defined in tools/ci/artifacts_handler.py, inside `ArtifactType` and `TYPE_PATTERNS_DICT`.
286-
287-
#### Upload
288-
289-
```shell
290-
python tools/ci/artifacts_handler.py upload
291-
```
292-
293-
will upload the files that match the file patterns to minio object storage with name:
294-
295-
`<pipeline_id>/<artifact_type>/<job_name>/<job_id>.zip`
296-
297-
For example, job 39043328 will upload these four files:
298-
299-
- `575500/map_and_elf_files/build_pytest_examples_esp32/39043328.zip`
300-
- `575500/build_dir_without_map_and_elf_files/build_pytest_examples_esp32/39043328.zip`
301-
- `575500/logs/build_pytest_examples_esp32/39043328.zip`
302-
- `575500/size_reports/build_pytest_examples_esp32/39043328.zip`
303-
304-
#### Download
305-
306-
You may run
307-
308-
```shell
309-
python tools/ci/artifacts_handler.py download --pipeline_id <pipeline_id>
310-
```
311-
312-
to download all files of the pipeline, or
313-
314-
```shell
315-
python tools/ci/artifacts_handler.py download --pipeline_id <pipeline_id> --job_name <job_name_or_pattern>
316-
```
317-
318-
to download all files with the specified job name or pattern, or
319-
320-
```shell
321-
python tools/ci/artifacts_handler.py download --pipeline_id <pipeline_id> --job_name <job_name_or_pattern> --type <artifact_type> <artifact_type> ...
322-
```
323-
324-
to download all files with the specified job name or pattern and artifact type(s).
325-
326-
You may check all detailed documentation with `python tools/ci/artifacts_handler.py download -h`
258+
Please refer to the documentation [here](https://docs.espressif.com/projects/idf-ci/en/latest/guides/cli.html)

.gitlab/ci/build.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
- pipeline_variables
2222
artifacts:
2323
paths:
24-
# The other artifacts patterns are defined under tools/ci/artifacts_handler.py
24+
# The other artifacts patterns are defined under .idf_ci.toml
2525
# Now we're uploading/downloading the binary files from our internal storage server
2626
#
2727
# keep the log file to help debug
@@ -44,7 +44,6 @@
4444
--modified-components ${MR_MODIFIED_COMPONENTS}
4545
--modified-files ${MR_MODIFIED_FILES}
4646
$TEST_BUILD_OPTS_EXTRA
47-
- python tools/ci/artifacts_handler.py upload
4847

4948
######################
5049
# build_template_app #
@@ -206,7 +205,7 @@ build_clang_test_apps_esp32p4:
206205
script:
207206
- ${IDF_PATH}/tools/ci/test_configure_ci_environment.sh
208207
- cd ${IDF_PATH}/tools/test_build_system
209-
- python ${IDF_PATH}/tools/ci/get_known_failure_cases_file.py
208+
- run_cmd idf-ci gitlab download-known-failure-cases-file ${KNOWN_FAILURE_CASES_FILE_NAME}
210209
- pytest
211210
--cleanup-idf-copy
212211
--parallel-count ${CI_NODE_TOTAL:-1}

.gitlab/ci/common.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ variables:
120120
source tools/ci/configure_ci_environment.sh
121121

122122
# add extra python packages
123-
export PYTHONPATH="$IDF_PATH/tools:$IDF_PATH/tools/esp_app_trace:$IDF_PATH/components/partition_table:$IDF_PATH/tools/ci/python_packages:$PYTHONPATH"
123+
export PYTHONPATH="$IDF_PATH/tools:$IDF_PATH/tools/ci:$IDF_PATH/tools/esp_app_trace:$IDF_PATH/components/partition_table:$IDF_PATH/tools/ci/python_packages:$PYTHONPATH"
124124

125125
.setup_tools_and_idf_python_venv: &setup_tools_and_idf_python_venv |
126126
# must use after setup_tools_except_target_test
@@ -217,7 +217,7 @@ variables:
217217

218218
.upload_failed_job_log_artifacts: &upload_failed_job_log_artifacts |
219219
if [ $CI_JOB_STATUS = "failed" ]; then
220-
python tools/ci/artifacts_handler.py upload --type logs
220+
run_cmd idf-ci gitlab upload-artifacts --type log
221221
fi
222222

223223
.before_script:minimal:

.gitlab/ci/host-test.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -303,7 +303,7 @@ test_pytest_qemu:
303303
--only-test-related
304304
-m qemu
305305
--modified-files ${MR_MODIFIED_FILES}
306-
- python tools/ci/get_known_failure_cases_file.py
306+
- run_cmd idf-ci gitlab download-known-failure-cases-file ${KNOWN_FAILURE_CASES_FILE_NAME}
307307
- run_cmd pytest
308308
--target $IDF_TARGET
309309
--log-cli-level DEBUG
@@ -331,7 +331,7 @@ test_pytest_linux:
331331
--target linux
332332
--only-test-related
333333
--modified-files ${MR_MODIFIED_FILES}
334-
- python tools/ci/get_known_failure_cases_file.py
334+
- run_cmd idf-ci gitlab download-known-failure-cases-file ${KNOWN_FAILURE_CASES_FILE_NAME}
335335
- run_cmd pytest
336336
--target linux
337337
--embedded-services idf
@@ -365,7 +365,7 @@ test_pytest_macos:
365365
--only-test-related
366366
-m macos
367367
--modified-files ${MR_MODIFIED_FILES}
368-
- python tools/ci/get_known_failure_cases_file.py
368+
- run_cmd idf-ci gitlab download-known-failure-cases-file ${KNOWN_FAILURE_CASES_FILE_NAME}
369369
- run_cmd pytest
370370
--target linux
371371
-m macos

.gitlab/ci/pre_check.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -144,9 +144,9 @@ pipeline_variables:
144144
fi
145145
- echo "OOCD_DISTRO_URL_ARMHF=$OOCD_DISTRO_URL_ARMHF" >> pipeline.env
146146
- echo "OOCD_DISTRO_URL_ARM64=$OOCD_DISTRO_URL_ARM64" >> pipeline.env
147-
- idf-ci gitlab pipeline-variables >> pipeline.env
147+
- run_cmd idf-ci gitlab pipeline-variables >> pipeline.env
148148
- cat pipeline.env
149-
- python tools/ci/artifacts_handler.py upload --type modified_files_and_components_report
149+
- run_cmd idf-ci gitlab upload-artifacts --type env
150150
artifacts:
151151
reports:
152152
dotenv: pipeline.env

.idf_ci.toml

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@ IDF_CI_BUILD = "1"
99
[gitlab]
1010

1111
[gitlab.build_pipeline]
12+
workflow_name = "build_child_pipeline"
13+
presigned_json_job_name = 'generate_pytest_build_report'
14+
1215
job_tags = ['build', 'shiny']
1316
job_template_name = '.dynamic_build_template'
1417
job_template_jinja = '' # write in tools/ci/dynamic_pipelines/templates/.dynamic_jobs.yml
@@ -38,3 +41,57 @@ include:
3841
- tools/ci/dynamic_pipelines/templates/.dynamic_jobs.yml
3942
- tools/ci/dynamic_pipelines/templates/generate_target_test_report.yml
4043
"""
44+
45+
[gitlab.artifacts.s3.debug]
46+
bucket = "idf-artifacts"
47+
patterns = [
48+
'**/build*/bootloader/*.map',
49+
'**/build*/bootloader/*.elf',
50+
'**/build*/*.map',
51+
'**/build*/*.elf',
52+
# customized
53+
'**/build*/esp_tee/*.map',
54+
'**/build*/esp_tee/*.elf',
55+
'**/build*/gdbinit/*',
56+
]
57+
58+
[gitlab.artifacts.s3.flash]
59+
bucket = "idf-artifacts"
60+
patterns = [
61+
'**/build*/bootloader/*.bin',
62+
'**/build*/*.bin',
63+
'**/build*/partition_table/*.bin',
64+
'**/build*/flasher_args.json',
65+
'**/build*/flash_project_args',
66+
'**/build*/config/sdkconfig.json',
67+
'**/build*/sdkconfig',
68+
'**/build*/project_description.json',
69+
# customized
70+
'**/build*/esp_tee/*.bin',
71+
]
72+
73+
[gitlab.artifacts.s3.log]
74+
bucket = "idf-artifacts"
75+
patterns = [
76+
'**/build*/build_log.txt',
77+
'**/build*/size.json',
78+
]
79+
80+
[gitlab.artifacts.s3.junit]
81+
bucket = "idf-artifacts"
82+
patterns = [
83+
'XUNIT_RESULT_*.xml',
84+
]
85+
86+
[gitlab.artifacts.s3.env]
87+
bucket = "idf-artifacts"
88+
patterns = [
89+
'pipeline.env',
90+
]
91+
92+
[gitlab.artifacts.s3.longterm]
93+
bucket = "longterm"
94+
if_clause = '"$CI_COMMIT_REF_NAME" == "master"'
95+
patterns = [
96+
'**/build*/size.json',
97+
]

0 commit comments

Comments
 (0)