Skip to content
Snippets Groups Projects
Commit 8a3f7184 authored by Chase Qi's avatar Chase Qi
Browse files

ci: search zephyr build images by machine name


Introduce machine variable for lava-test and search build images for the
test target device only to make sure only images for the target device
submitted for test.

This closes #215.

Signed-off-by: default avatarChase Qi <chase.qi@linaro.org>
parent 80dc4eb9
No related branches found
No related tags found
1 merge request!30flavours/zephyr/local.conf.sample: Bump CONF_VERSION
...@@ -125,8 +125,9 @@ lava-linux-avenger96: ...@@ -125,8 +125,9 @@ lava-linux-avenger96:
stage: test stage: test
extends: .lava-test extends: .lava-test
variables: variables:
CI_LAVA_JOB_DEFINITION: "https://git.ostc-eu.org/OSTC/infrastructure/lava/lava-config/-/raw/master/lava.ostc-eu.org/job-definitions/ci/avenger96-acts.yaml" MACHINE: stm32mp1-av96
CI_BUILD_JOB_NAME: linux-stm32mp1-av96 CI_BUILD_JOB_NAME: linux-stm32mp1-av96
CI_LAVA_JOB_DEFINITION: "https://git.ostc-eu.org/OSTC/infrastructure/lava/lava-config/-/raw/master/lava.ostc-eu.org/job-definitions/ci/avenger96-acts.yaml"
CI_REPORT_JOB_NAME: lava-report CI_REPORT_JOB_NAME: lava-report
rules: rules:
- when: never - when: never
...@@ -136,8 +137,9 @@ lava-qemu-x86: ...@@ -136,8 +137,9 @@ lava-qemu-x86:
stage: test stage: test
extends: .lava-test extends: .lava-test
variables: variables:
CI_LAVA_JOB_DEFINITION: "https://git.ostc-eu.org/OSTC/infrastructure/lava/lava-config/-/raw/master/lava.ostc-eu.org/job-definitions/ci/qemu-x86.yaml" MACHINE: qemux86
CI_BUILD_JOB_NAME: linux-qemu-x86 CI_BUILD_JOB_NAME: linux-qemu-x86
CI_LAVA_JOB_DEFINITION: "https://git.ostc-eu.org/OSTC/infrastructure/lava/lava-config/-/raw/master/lava.ostc-eu.org/job-definitions/ci/qemu-x86.yaml"
CI_REPORT_JOB_NAME: lava-report CI_REPORT_JOB_NAME: lava-report
lava-qemu-x86_64: lava-qemu-x86_64:
...@@ -145,8 +147,9 @@ lava-qemu-x86_64: ...@@ -145,8 +147,9 @@ lava-qemu-x86_64:
stage: test stage: test
extends: .lava-test extends: .lava-test
variables: variables:
CI_LAVA_JOB_DEFINITION: "https://git.ostc-eu.org/OSTC/infrastructure/lava/lava-config/-/raw/master/lava.ostc-eu.org/job-definitions/ci/qemu-x86_64.yaml" MACHINE: qemux86-64
CI_BUILD_JOB_NAME: linux-qemu-x86_64 CI_BUILD_JOB_NAME: linux-qemu-x86_64
CI_LAVA_JOB_DEFINITION: "https://git.ostc-eu.org/OSTC/infrastructure/lava/lava-config/-/raw/master/lava.ostc-eu.org/job-definitions/ci/qemu-x86_64.yaml"
CI_REPORT_JOB_NAME: lava-report CI_REPORT_JOB_NAME: lava-report
lava-zephyr-96b-nitrogen-tests: lava-zephyr-96b-nitrogen-tests:
...@@ -154,8 +157,9 @@ lava-zephyr-96b-nitrogen-tests: ...@@ -154,8 +157,9 @@ lava-zephyr-96b-nitrogen-tests:
stage: test stage: test
extends: .lava-test extends: .lava-test
variables: 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" MACHINE: 96b-nitrogen
CI_BUILD_JOB_NAME: zephyr-96b-nitrogen-tests CI_BUILD_JOB_NAME: zephyr-96b-nitrogen-tests
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_REPORT_JOB_NAME: lava-report CI_REPORT_JOB_NAME: lava-report
lava-zephyr-qemu-cortex-m3: lava-zephyr-qemu-cortex-m3:
...@@ -163,8 +167,9 @@ lava-zephyr-qemu-cortex-m3: ...@@ -163,8 +167,9 @@ lava-zephyr-qemu-cortex-m3:
stage: test stage: test
extends: .lava-test extends: .lava-test
variables: variables:
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" MACHINE: qemu-cortex-m3
CI_BUILD_JOB_NAME: zephyr-qemu-cortex-m3 CI_BUILD_JOB_NAME: zephyr-qemu-cortex-m3
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_REPORT_JOB_NAME: lava-report CI_REPORT_JOB_NAME: lava-report
lava-zephyr-qemu-x86: lava-zephyr-qemu-x86:
...@@ -172,8 +177,9 @@ lava-zephyr-qemu-x86: ...@@ -172,8 +177,9 @@ lava-zephyr-qemu-x86:
stage: test stage: test
extends: .lava-test extends: .lava-test
variables: variables:
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" MACHINE: qemu-x86
CI_BUILD_JOB_NAME: zephyr-qemu-x86 CI_BUILD_JOB_NAME: zephyr-qemu-x86
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_REPORT_JOB_NAME: lava-report CI_REPORT_JOB_NAME: lava-report
lava-report: lava-report:
......
...@@ -16,12 +16,15 @@ ...@@ -16,12 +16,15 @@
echo "precondition failed - please disable the child job if CI_LAVA_TOKEN not set in gitlab CI/CD variables" echo "precondition failed - please disable the child job if CI_LAVA_TOKEN not set in gitlab CI/CD variables"
&& exit 1 ) && exit 1 )
# Check if the job is configured properly. # Check if the job is configured properly.
- test -n "$CI_LAVA_JOB_DEFINITION" || ( - test -n "$MACHINE" || (
echo "precondition failed - set CI_LAVA_JOB_DEFINITION to the URL of the LAVA test job definition" echo "precondition failed - set MACHINE to the name of the target device for which the image is built"
&& exit 1 ) && exit 1 )
- test -n "$CI_BUILD_JOB_NAME" || ( - test -n "$CI_BUILD_JOB_NAME" || (
echo "precondition failed - set CI_BUILD_JOB_NAME to the appropriate job name from which LAVA will pick up build artifact" echo "precondition failed - set CI_BUILD_JOB_NAME to the appropriate job name from which LAVA will pick up build artifact"
&& exit 1 ) && exit 1 )
- test -n "$CI_LAVA_JOB_DEFINITION" || (
echo "precondition failed - set CI_LAVA_JOB_DEFINITION to the URL of the LAVA test job definition"
&& exit 1 )
- test -n "$CI_REPORT_JOB_NAME" || ( - test -n "$CI_REPORT_JOB_NAME" || (
echo "precondition failed - set CI_REPORT_JOB_NAME to the CI job name which will gather results back from LAVA" echo "precondition failed - set CI_REPORT_JOB_NAME to the CI job name which will gather results back from LAVA"
&& exit 1 ) && exit 1 )
...@@ -44,7 +47,7 @@ ...@@ -44,7 +47,7 @@
- | - |
rm -rf lava_jobs && mkdir lava_jobs rm -rf lava_jobs && mkdir lava_jobs
if echo "${CI_BUILD_JOB_NAME}" | grep -i "zephyr"; then if echo "${CI_BUILD_JOB_NAME}" | grep -i "zephyr"; then
for image in $(find artifacts/ -name "*.elf" -exec basename {} \;); do for image in $(find artifacts/images/${MACHINE} -name "*.elf" -exec basename {} \;); do
job_name=$(basename "${image}" ".elf") job_name=$(basename "${image}" ".elf")
echo "--- Generating lava job definition ${job_name}.yaml ---" echo "--- Generating lava job definition ${job_name}.yaml ---"
sed "s/\$elf_file/$image/" job_def.yaml | tee lava_jobs/"${job_name}".yaml sed "s/\$elf_file/$image/" job_def.yaml | tee lava_jobs/"${job_name}".yaml
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment