From 47bc10cf4e4b124e7b1c92b6a1e589c8639efb7d Mon Sep 17 00:00:00 2001 From: Chase Qi <chase.qi@linaro.org> Date: Thu, 25 Aug 2022 10:53:39 +0800 Subject: [PATCH] ci: enable MR test on qemu machines Run boot test on the below qemu machines: * qemu-x86 * qemu-cortex-m3 Closes https://gitlab.eclipse.org/eclipse/oniro-core/meta-zephyr/-/issues/38 Signed-off-by: Chase Qi <chase.qi@linaro.org> --- .gitlab-ci.yml | 49 +++++++++++++++++++++++-------------------------- 1 file changed, 23 insertions(+), 26 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 0785e13..dbc6d97 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -63,54 +63,51 @@ linux-seco-imx8mm-c61-4gb-extra-clang: rules: - when: never - -# Run lava test and report jobs for scheduled pipeline only. -.lava-test: - rules: - - if: '$CI_LAVA_TOKEN == null' - when: never - - if: '$CI_PIPELINE_SOURCE == "schedule"' - -.lava-report: +.lava-test-mr: + extends: .lava-test + variables: + CI_LAVA_JOB_PRIORITY: "high" + CI_SQUAD_GROUP_NAME: "merge-request" + CI_SQUAD_PROJECT_NAME: "meta-zephyr" rules: - - if: '$CI_LAVA_TOKEN == null' + # Do not run the build if the token not set for job submission. + - if: '$CI_SQUAD_TOKEN == null' when: never - - if: '$CI_PIPELINE_SOURCE == "schedule"' + # Do not run the build for draft merge requests unless manually triggered. + - if: '$CI_PIPELINE_SOURCE == "merge_request_event" && $CI_MERGE_REQUEST_TITLE =~ /^(wip|draft):.*/i' when: manual + # Run the build when a merge request is created. + - if: '$CI_PIPELINE_SOURCE == "merge_request_event"' ## ## Submit jobs to LAVA ## -lava-zephyr-96b-nitrogen-tests: - needs: [zephyr-96b-nitrogen-tests-gcc] - stage: test - extends: .lava-test - variables: - CI_LAVA_JOB_DEFINITION: "https://git.ostc-eu.org/OSTC/infrastructure/lava/lava-config/-/raw/master/lava.ostc-eu.org/job-definitions/ci/nitrogen-test.yaml" - CI_BUILD_JOB_NAME: zephyr-96b-nitrogen-tests - CI_REPORT_JOB_NAME: lava-report - lava-zephyr-qemu-cortex-m3: needs: [zephyr-qemu-cortex-m3-gcc] stage: test - extends: .lava-test + extends: .lava-test-mr variables: + MACHINE: qemu-cortex-m3 + CI_BUILD_JOB_NAME: zephyr-qemu-cortex-m3-gcc CI_LAVA_JOB_DEFINITION: "https://git.ostc-eu.org/OSTC/infrastructure/lava/lava-config/-/raw/master/lava.ostc-eu.org/job-definitions/ci/qemu-zephyr-cortex-m3.yaml" - CI_BUILD_JOB_NAME: zephyr-qemu-cortex-m3 CI_REPORT_JOB_NAME: lava-report lava-zephyr-qemu-x86: needs: [zephyr-qemu-x86-gcc] stage: test - extends: .lava-test + extends: .lava-test-mr variables: + MACHINE: qemu-x86 + CI_BUILD_JOB_NAME: zephyr-qemu-x86-gcc CI_LAVA_JOB_DEFINITION: "https://git.ostc-eu.org/OSTC/infrastructure/lava/lava-config/-/raw/master/lava.ostc-eu.org/job-definitions/ci/qemu-zephyr-x86.yaml" - CI_BUILD_JOB_NAME: zephyr-qemu-x86 CI_REPORT_JOB_NAME: lava-report ## -## Get the results back from LAVA. +## Get the results back from SQUAD. ## lava-report: - needs: [lava-zephyr-96b-nitrogen-tests, lava-zephyr-qemu-cortex-m3, lava-zephyr-qemu-x86] extends: .lava-report + dependencies: [] + needs: + - lava-zephyr-qemu-cortex-m3 + - lava-zephyr-qemu-x86 -- GitLab