[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 4/6] gitlab-ci: Fix Avocado cache usage
From: |
Thomas Huth |
Subject: |
[PULL 4/6] gitlab-ci: Fix Avocado cache usage |
Date: |
Wed, 5 Aug 2020 11:57:53 +0200 |
In commit 6957fd98dc ("gitlab: add avocado asset caching") we
tried to save the Avocado cache (as in commit c1073e44b4 with
Travis-CI) however it doesn't work as expected. For some reason
Avocado uses /root/avocado_cache/ which we can not select later.
Manually generate a Avocado config to force the use of the
current job's directory.
This patch is based on an earlier version from Philippe Mathieu-Daudé.
Message-Id: <20200730141326.8260-5-thuth@redhat.com>
Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
Signed-off-by: Thomas Huth <thuth@redhat.com>
---
.gitlab-ci.yml | 25 +++++++++++++++++++------
1 file changed, 19 insertions(+), 6 deletions(-)
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index e96bcd50f8..9820066379 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -47,11 +47,24 @@ include:
- find . -type f -exec touch {} +
- make $MAKE_CHECK_ARGS
-.post_acceptance_template: &post_acceptance
+.acceptance_template: &acceptance_definition
+ cache:
+ key: "${CI_JOB_NAME}-cache"
+ paths:
+ - ${CI_PROJECT_DIR}/avocado-cache
+ policy: pull-push
+ before_script:
+ - mkdir -p ~/.config/avocado
+ - echo "[datadir.paths]" > ~/.config/avocado/avocado.conf
+ - echo "cache_dirs = ['${CI_PROJECT_DIR}/avocado-cache']"
+ >> ~/.config/avocado/avocado.conf
+ - if [ -d ${CI_PROJECT_DIR}/avocado-cache ]; then
+ du -chs ${CI_PROJECT_DIR}/avocado-cache ;
+ fi
after_script:
- cd build
- python3 -c 'import json; r =
json.load(open("tests/results/latest/results.json")); [print(t["logfile"]) for
t in r["tests"] if t["status"] not in ("PASS", "SKIP")]' | xargs cat
- - du -chs $HOME/avocado/data/cache
+ - du -chs ${CI_PROJECT_DIR}/avocado-cache
build-system-ubuntu:
<<: *native_build_job_definition
@@ -81,7 +94,7 @@ acceptance-system-ubuntu:
variables:
IMAGE: ubuntu2004
MAKE_CHECK_ARGS: check-acceptance
- <<: *post_acceptance
+ <<: *acceptance_definition
build-system-debian:
<<: *native_build_job_definition
@@ -111,7 +124,7 @@ acceptance-system-debian:
variables:
IMAGE: debian-amd64
MAKE_CHECK_ARGS: check-acceptance
- <<: *post_acceptance
+ <<: *acceptance_definition
build-system-fedora:
<<: *native_build_job_definition
@@ -141,7 +154,7 @@ acceptance-system-fedora:
variables:
IMAGE: fedora
MAKE_CHECK_ARGS: check-acceptance
- <<: *post_acceptance
+ <<: *acceptance_definition
build-system-centos:
<<: *native_build_job_definition
@@ -171,7 +184,7 @@ acceptance-system-centos:
variables:
IMAGE: centos8
MAKE_CHECK_ARGS: check-acceptance
- <<: *post_acceptance
+ <<: *acceptance_definition
build-disabled:
<<: *native_build_job_definition
--
2.18.1
- [PULL 0/6] Improve gitlab-CI and fix a compiler warning, Thomas Huth, 2020/08/05
- [PULL 1/6] tests/docker: Add python3-venv and netcat to the debian-amd64 container, Thomas Huth, 2020/08/05
- [PULL 2/6] tests/acceptance: Disable the rx sash and arm cubieboard replay test on Gitlab, Thomas Huth, 2020/08/05
- [PULL 3/6] gitlab-ci.yml: Add build-system-debian and build-system-centos jobs, Thomas Huth, 2020/08/05
- [PULL 4/6] gitlab-ci: Fix Avocado cache usage,
Thomas Huth <=
- [PULL 5/6] target/riscv/vector_helper: Fix build on 32-bit big endian hosts, Thomas Huth, 2020/08/05
- [PULL 6/6] Get rid of the libqemustub.a remainders, Thomas Huth, 2020/08/05
- Re: [PULL 0/6] Improve gitlab-CI and fix a compiler warning, Peter Maydell, 2020/08/05
- Re: [PULL 0/6] Improve gitlab-CI and fix a compiler warning, Alistair Francis, 2020/08/06