mirror of
https://git.yoctoproject.org/meta-zephyr
synced 2026-09-24 16:36:21 +02:00
CI: Use the matrix to ovleray additional Kas files
Adopt the jobs-to-kas helper script from meta-arm, which uses Gitlab's parellel matrix to overlay additional Kas files on top of the base Kas file (based on $CI_JOB_NAME). This allows multiple combinations of Kas file overlays to be easily tested with minimal boilerplate. Signed-off-by: Peter Hoyes <Peter.Hoyes@arm.com> Tested-by: Jon Mason <jon.mason@arm.com> Signed-off-by: Naveen Saini <naveen.kumar.saini@intel.com>
This commit is contained in:
committed by
Naveen Saini
parent
17db53ed83
commit
a5d6af7144
@@ -80,11 +80,17 @@ nrf52840dk-nrf52840:
|
|||||||
qemu-cortex-a53:
|
qemu-cortex-a53:
|
||||||
extends: .build
|
extends: .build
|
||||||
|
|
||||||
qemu-cortex-m0/testimage:
|
qemu-cortex-m0:
|
||||||
extends: .build
|
extends: .build
|
||||||
|
parallel:
|
||||||
|
matrix:
|
||||||
|
- TESTING: testimage
|
||||||
|
|
||||||
qemu-cortex-m3/testimage:
|
qemu-cortex-m3:
|
||||||
extends: .build
|
extends: .build
|
||||||
|
parallel:
|
||||||
|
matrix:
|
||||||
|
- TESTING: testimage
|
||||||
|
|
||||||
qemu-cortex-r5:
|
qemu-cortex-r5:
|
||||||
extends: .build
|
extends: .build
|
||||||
@@ -92,8 +98,11 @@ qemu-cortex-r5:
|
|||||||
qemu-nios2:
|
qemu-nios2:
|
||||||
extends: .build
|
extends: .build
|
||||||
|
|
||||||
qemu-x86/testimage:
|
qemu-x86:
|
||||||
extends: .build
|
extends: .build
|
||||||
|
parallel:
|
||||||
|
matrix:
|
||||||
|
- TESTING: testimage
|
||||||
|
|
||||||
stm32mp157c-dk2:
|
stm32mp157c-dk2:
|
||||||
extends: .build
|
extends: .build
|
||||||
|
|||||||
@@ -1,19 +1,26 @@
|
|||||||
#! /bin/bash
|
#! /bin/bash
|
||||||
|
|
||||||
# Read a GitLab CI job name on $1 and transform it to a
|
# This script is expecting an input of machine name, optionally followed by a
|
||||||
# list of Kas yaml files
|
# colon and a list of one or more parameters separated by commas between
|
||||||
|
# brackets. For example, the following are acceptable:
|
||||||
|
# qemu-x86
|
||||||
|
# qemu-cortex-m3: [testimage]
|
||||||
|
# qemu-cortex-a53: [zephyr-toolchain, testimage]
|
||||||
|
#
|
||||||
|
# Turn this list into a series of yml files separated by colons to pass to kas
|
||||||
|
|
||||||
set -e -u
|
set -e -u
|
||||||
|
|
||||||
# Read Job namne from $1 and split on /
|
FILES="ci/$(echo $1 | cut -d ':' -f 1).yml"
|
||||||
IFS=/ read -r -a PARTS<<<$1
|
|
||||||
|
|
||||||
# Prefix each part with ci/
|
for i in $(echo $1 | cut -s -d ':' -f 2 | sed 's/[][,]//g'); do
|
||||||
PARTS=("${PARTS[@]/#/ci/}")
|
# Given that there is no yml file for default, we can simply ignore those
|
||||||
|
# parameters. They are necessary to pass in so that matrix can correctly
|
||||||
|
# setup all of the permutations of each individual run.
|
||||||
|
if [[ $i == 'default' ]]; then
|
||||||
|
continue
|
||||||
|
fi
|
||||||
|
FILES+=":ci/$i.yml"
|
||||||
|
done
|
||||||
|
|
||||||
# Suffix each part with .yml
|
echo $FILES
|
||||||
PARTS=("${PARTS[@]/%/.yml}")
|
|
||||||
|
|
||||||
# Print colon-separated
|
|
||||||
IFS=":"
|
|
||||||
echo "${PARTS[*]}"
|
|
||||||
|
|||||||
Reference in New Issue
Block a user