diff options
author | Jeremy Bettis <jbettis@google.com> | 2021-12-23 11:18:04 -0700 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2022-01-05 01:24:44 +0000 |
commit | f814ad822887e98d863f8a90b9ae2c46d61aeae3 (patch) | |
tree | 102f6497e940c0b1c985ab26222b9acc2041d5e8 /.gitlab-ci.yml | |
parent | dc23d6713dae2065d528d5d57058a62fd4797d93 (diff) | |
download | chrome-ec-f814ad822887e98d863f8a90b9ae2c46d61aeae3.tar.gz |
gitlab: Download twister coverage from codecov.io
Loop over the merged commits from the upstream zephyr repo until we find
one that has a coverage report uploaded, and download that.
The coverage won't totally match up with the code we have checked out,
but it should be close, and this will save us many hours to re-run all
the tests.
BRANCH=None
BUG=None
TEST=Pushed manually to gitlab coverage branch
Signed-off-by: Jeremy Bettis <jbettis@google.com>
Change-Id: I2d2c4462e94136ae5e521b1b212e914e7c302550
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3367175
Commit-Queue: Jeremy Bettis <jbettis@chromium.org>
Tested-by: Jeremy Bettis <jbettis@chromium.org>
Auto-Submit: Jeremy Bettis <jbettis@chromium.org>
Reviewed-by: Denis Brockus <dbrockus@chromium.org>
Commit-Queue: Denis Brockus <dbrockus@chromium.org>
Diffstat (limited to '.gitlab-ci.yml')
-rw-r--r-- | .gitlab-ci.yml | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index afda622446..526df01c7c 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -223,3 +223,28 @@ testall: - zmake --zephyr-base "${ZEPHYR_BASE}" --modules-dir "${MODULES_DIR}" -l DEBUG testall +twister_coverage: + stage: test + needs: ["seed_cache"] + script: + - mkdir -p build/zephyr_codecov + - for commitid in $(cd "${ZEPHYR_BASE}" ; git fetch --depth=100 ; git log | awk '/GitOrigin-RevId:/ {print $2}') ; do + echo "COMMITID = ${commitid?}" ; + if wget -O /tmp/coverage.html "https://codecov.io/gh/zephyrproject-rtos/zephyr/commit/${commitid?}/build" ; then + downloadurl=$(sed -e '/download\/build/!d' -e 's|^.*href="|https://codecov.io|' -e 's|".*$||' /tmp/coverage.html | head -1) ; + echo "DOWNLOADURL = ${downloadurl?}" ; + wget -O build/zephyr_codecov/merged.info.raw "${downloadurl?}" ; + sed <build/zephyr_codecov/merged.info.raw >build/zephyr_codecov/merged.info + -e '1,/<<<<<< network/d' -e '/<<<<<< EOF/,$d' ; + sed <build/zephyr_codecov/merged.info >build/zephyr_codecov/fixed.info + -e "s|/__w/zephyr/zephyr|${ZEPHYR_BASE}|" + -e "s|/__w/zephyr/modules/hal/cmsis|${MODULES_DIR}/cmsis|" + -e "s|/__w/zephyr/modules|${MODULES_DIR}|" ; + break ; + fi ; + done + - lcov --summary build/zephyr_codecov/fixed.info + artifacts: + paths: + - build/zephyr_codecov/fixed.info + expire_in: 1 week |