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

ci: generate lava-test badge


lava-test badge shows success rate for on device testing in lava.

Signed-off-by: default avatarChase Qi <chase.qi@linaro.org>
parent 9509f17f
No related branches found
No related tags found
1 merge request!30flavours/zephyr/local.conf.sample: Bump CONF_VERSION
...@@ -186,6 +186,10 @@ lava-report: ...@@ -186,6 +186,10 @@ lava-report:
needs: [lava-qemu-x86, lava-qemu-x86_64, lava-zephyr-96b-nitrogen-tests, lava-zephyr-qemu-cortex-m3, lava-zephyr-qemu-x86] needs: [lava-qemu-x86, lava-qemu-x86_64, lava-zephyr-96b-nitrogen-tests, lava-zephyr-qemu-cortex-m3, lava-zephyr-qemu-x86]
extends: .lava-report extends: .lava-report
lava-badge:
needs: [lava-report]
extends: .lava-badge
.build-with-kaniko: .build-with-kaniko:
stage: build stage: build
image: image:
......
...@@ -125,3 +125,27 @@ ...@@ -125,3 +125,27 @@
# Run the build when a tag is placed. # Run the build when a tag is placed.
- if: '$CI_COMMIT_TAG' - if: '$CI_COMMIT_TAG'
when: manual when: manual
.lava-badge:
interruptible: true
image:
name: registry.booting.oniroproject.org/distro/oniro/bitbake-builder:latest
stage: report
variables:
GIT_STRATEGY: none
script:
- |
set -x
curl --silent "$CI_API_V4_URL/projects/$CI_PROJECT_ID/pipelines/$CI_PIPELINE_ID/test_report" > test-report.json
total_count="$(jq '.total_count' test-report.json)"
success_count="$(jq '.success_count' test-report.json)"
success_rate=$(( 100 * success_count / total_count ))
anybadge --label=lava-test --value=${success_rate} --suffix='%' --file=lava-test.svg 50=red 60=orange 80=yellow 100=green
set +x
artifacts:
when: always
paths:
- lava-test.svg
rules:
# Run the build when it is scheduled.
- if: $CI_PIPELINE_SOURCE == "schedule"
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