From f52cec0f26dbbc0cc8bfdd733735e755f5e1c1b3 Mon Sep 17 00:00:00 2001 From: Samuel Obuch Date: Wed, 14 May 2025 12:36:24 +0200 Subject: [PATCH] ci: select OpenOCD binary based on runner --- .gitlab/ci/common.yml | 22 +++++++++++++++------- .gitlab/ci/pre_check.yml | 2 ++ .gitlab/ci/target-test.yml | 3 ++- 3 files changed, 19 insertions(+), 8 deletions(-) diff --git a/.gitlab/ci/common.yml b/.gitlab/ci/common.yml index 0bae84497f..b86108346b 100644 --- a/.gitlab/ci/common.yml +++ b/.gitlab/ci/common.yml @@ -165,13 +165,21 @@ variables: fi # Custom OpenOCD - if [[ ! -z "$OOCD_DISTRO_URL" && "$CI_JOB_STAGE" == "target_test" ]]; then - echo "Using custom OpenOCD from ${OOCD_DISTRO_URL}" - wget $OOCD_DISTRO_URL - ARCH_NAME=$(basename $OOCD_DISTRO_URL) - tar -x -f $ARCH_NAME - export OPENOCD_SCRIPTS=$PWD/openocd-esp32/share/openocd/scripts - export PATH=$PWD/openocd-esp32/bin:$PATH + if [[ "$CI_JOB_STAGE" == "target_test" ]]; then + machine="$(uname -m)" + if [[ "$machine" == "armv7l" ]] ; then + OOCD_DISTRO_URL="$OOCD_DISTRO_URL_ARMHF" + elif [[ "$machine" == "aarch64" ]] ; then + OOCD_DISTRO_URL="$OOCD_DISTRO_URL_ARM64" + fi + if [[ ! -z "$OOCD_DISTRO_URL" ]]; then + echo "Using custom OpenOCD from ${OOCD_DISTRO_URL}" + wget $OOCD_DISTRO_URL + ARCH_NAME=$(basename $OOCD_DISTRO_URL) + tar -x -f $ARCH_NAME + export OPENOCD_SCRIPTS=$PWD/openocd-esp32/share/openocd/scripts + export PATH=$PWD/openocd-esp32/bin:$PATH + fi fi if [[ -n "$CI_PYTHON_TOOL_REPO" ]]; then diff --git a/.gitlab/ci/pre_check.yml b/.gitlab/ci/pre_check.yml index 0ee3dc7a95..cee1634422 100644 --- a/.gitlab/ci/pre_check.yml +++ b/.gitlab/ci/pre_check.yml @@ -198,6 +198,8 @@ pipeline_variables: if echo "$CI_MERGE_REQUEST_LABELS" | egrep "(^|,)BUILD_AND_TEST_ALL_APPS(,|$)"; then echo "BUILD_AND_TEST_ALL_APPS=1" >> pipeline.env fi + - echo "OOCD_DISTRO_URL_ARMHF=$OOCD_DISTRO_URL_ARMHF" >> pipeline.env + - echo "OOCD_DISTRO_URL_ARM64=$OOCD_DISTRO_URL_ARM64" >> pipeline.env - cat pipeline.env - python tools/ci/artifacts_handler.py upload --type modified_files_and_components_report artifacts: diff --git a/.gitlab/ci/target-test.yml b/.gitlab/ci/target-test.yml index c1fab4156d..a986dbd14e 100644 --- a/.gitlab/ci/target-test.yml +++ b/.gitlab/ci/target-test.yml @@ -4,7 +4,8 @@ - .before_script:fetch:target_test stage: target_test timeout: 1 hour - dependencies: [] + needs: + - pipeline_variables cache: # Usually do not need submodule-cache in target_test - key: pip-cache