mirror of
https://git.yoctoproject.org/meta-arm
synced 2026-01-12 03:10:15 +00:00
ci: add yocto-check-layers step
Add a job to run yocto-check-layers to validate a selection of layers are Yocto Project Compatible. Right now we validate: - meta-arm - meta-arm-bsp - meta-arm-toolchain - meta-gem5 meta-atp and meta-arm-autonomy are currently skipped: meta-atp fails and meta-arm-autonomy has a larger set of dependant layers and will be added later. Change-Id: Ia0c8c16e4228eeb461bd213b30703e950ede656f Signed-off-by: Ross Burton <ross.burton@arm.com>
This commit is contained in:
@@ -72,6 +72,14 @@ machine-coverage:
|
||||
# Build stage, the actual build jobs
|
||||
#
|
||||
|
||||
# Validate layers are Yocto Project Compatible
|
||||
check-layers:
|
||||
extends: .setup
|
||||
coverage: '/Coverage: \d+/'
|
||||
script:
|
||||
- kas shell --update --force-checkout ci/base.yml:ci/meta-python.yml --command \
|
||||
"$CI_PROJECT_DIR/ci/check-layers.py $CI_PROJECT_DIR/ci/check-layers.yml $CI_PROJECT_DIR $KAS_WORK_DIR"
|
||||
|
||||
corstone500:
|
||||
extends: .build
|
||||
|
||||
|
||||
43
ci/check-layers.py
Executable file
43
ci/check-layers.py
Executable file
@@ -0,0 +1,43 @@
|
||||
#! /usr/bin/env python3
|
||||
|
||||
import argparse
|
||||
import pathlib
|
||||
import re
|
||||
import subprocess
|
||||
import sys
|
||||
|
||||
import yaml
|
||||
|
||||
if __name__ == "__main__":
|
||||
parser = argparse.ArgumentParser()
|
||||
parser.add_argument("config", type=argparse.FileType())
|
||||
parser.add_argument("metaarm", type=pathlib.Path, help="Path to meta-arm")
|
||||
parser.add_argument("others", type=pathlib.Path, help="Path to parent of dependencies")
|
||||
args = parser.parse_args()
|
||||
|
||||
config = yaml.safe_load(args.config)
|
||||
layers = config["layers"]
|
||||
dependencies = config["dependencies"]
|
||||
|
||||
found_layers = [p for p in args.metaarm.glob("meta-*") if p.is_dir()]
|
||||
print(f"Testing {len(layers)} layers: {', '.join(layers)}.")
|
||||
print(f"Found {len(found_layers)} layers in meta-arm.")
|
||||
print()
|
||||
|
||||
cli = ["yocto-check-layer-wrapper",]
|
||||
cli.extend([args.metaarm / layer for layer in layers])
|
||||
cli.append("--dependency")
|
||||
cli.extend([args.others / layer for layer in dependencies])
|
||||
|
||||
passed = 0
|
||||
process = subprocess.Popen(cli, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, universal_newlines=True)
|
||||
while True:
|
||||
line = process.stdout.readline()
|
||||
if process.poll() is not None:
|
||||
break
|
||||
print(line.strip())
|
||||
if re.search(r"meta-.+ PASS", line):
|
||||
passed += 1
|
||||
|
||||
print(f"Coverage: {int(passed / len(found_layers) * 100)}%")
|
||||
sys.exit(process.returncode)
|
||||
7
ci/check-layers.yml
Normal file
7
ci/check-layers.yml
Normal file
@@ -0,0 +1,7 @@
|
||||
layers:
|
||||
- meta-arm
|
||||
- meta-arm-bsp
|
||||
- meta-arm-toolchain
|
||||
- meta-gem5
|
||||
dependencies:
|
||||
- meta-openembedded/meta-oe
|
||||
Reference in New Issue
Block a user