Files
esp-idf/tools/ci/dynamic_pipelines/templates/.dynamic_jobs.yml
T
2026-03-10 10:37:23 +08:00

92 lines
3.1 KiB
YAML

# This file is used to generate build jobs for pytest case dynamic pipeline
# don't add real jobs in this file
########################
# Build Jobs Templates #
########################
.dynamic_build_template:
extends:
- .after_script:build
image: $ESP_ENV_IMAGE
tags: [build, shiny]
stage: build
timeout: 2 hour
variables:
# Enable ccache for all build jobs. See configure_ci_environment.sh for more ccache related settings.
IDF_CCACHE_ENABLE: "1"
# Since the version 3.21 CMake passes source files and include dirs to ninja using absolute paths.
# Needed for pytest junit reports.
INSTALL_EXTRA_TOOLS: cmake
needs:
- pipeline: $PARENT_PIPELINE_ID
job: generate_build_child_pipeline
- pipeline: $PARENT_PIPELINE_ID
job: pipeline_variables
artifacts:
paths:
# The other artifacts patterns are defined under .idf_ci.toml
# Now we're uploading/downloading the binary files from our internal storage server
# keep the log file to help debug
- "**/build*/build_log.txt"
# build spec files
- build_summary_*.xml
# list of built apps
- app_info_*.txt
when: always
expire_in: 1 week
script:
# CI specific options start from "--parallel-count xxx". could ignore when running locally
- run_cmd idf-ci build run
--parallel-count ${CI_NODE_TOTAL:-1}
--parallel-index ${CI_NODE_INDEX:-1}
--modified-files ${MR_MODIFIED_FILES}
.dynamic_target_test_template:
image: $TARGET_TEST_ENV_IMAGE
stage: target_test
timeout: 1 hour
variables:
GIT_STRATEGY: "fetch"
SUBMODULES_TO_FETCH: "none"
# set while generating the pipeline
nodes: ""
INSTALL_EXTRA_TOOLS: "xtensa-esp-elf-gdb riscv32-esp-elf-gdb openocd-esp32 esp-rom-elfs"
PYTEST_EXTRA_FLAGS: "--dev-passwd ${ETHERNET_TEST_PASSWORD} --dev-user ${ETHERNET_TEST_USER} --capture=fd --verbosity=0 --unity-test-report-mode merge"
needs:
- pipeline: $PARENT_PIPELINE_ID
job: pipeline_variables
cache:
# Usually do not need submodule-cache in target_test
- key: pip-cache-${LATEST_GIT_TAG}
paths:
- .cache/pip
policy: pull
artifacts:
paths:
- XUNIT_RESULT*.xml
- pytest-embedded/
reports:
junit: XUNIT_RESULT*.xml
when: always
expire_in: 1 week
script:
- run_cmd idf-ci gitlab download-known-failure-cases-file ${KNOWN_FAILURE_CASES_FILE_NAME}
# get runner env config file
- retry_failed git clone $TEST_ENV_CONFIG_REPO
- run_cmd python $CHECKOUT_REF_SCRIPT ci-test-runner-configs ci-test-runner-configs
# CI specific options start from "--known-failure-cases-file xxx". could ignore when running locally
- run_cmd pytest $nodes
--pipeline-id $PARENT_PIPELINE_ID
--junitxml=XUNIT_RESULT_${CI_JOB_ID}.xml
--ignore-result-files ${KNOWN_FAILURE_CASES_FILE_NAME}
--parallel-count ${CI_NODE_TOTAL:-1}
--parallel-index ${CI_NODE_INDEX:-1}
${PYTEST_EXTRA_FLAGS}
after_script:
- source tools/ci/utils.sh
- run_cmd idf-ci gitlab upload-artifacts --type junit
.timeout_4h_template:
timeout: 4 hours