From: Peter Hutterer Date: Wed, 19 May 2021 00:25:19 +0000 (+1000) Subject: gitlab CI: make the qemu selection automatic X-Git-Tag: accepted/tizen/unified/20231121.102917~50 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=7ac62f65b98e7c86722f141f530bd1e4cf77078f;p=platform%2Fupstream%2Flibevdev.git gitlab CI: make the qemu selection automatic Generate the snippet for whichever is the last version in the list for the want_qemu tag. And move the want_qemu tag up so it's more obvious in the config file. Signed-off-by: Peter Hutterer --- diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 0373ffa..0cb1cab 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -225,29 +225,6 @@ check-merge-request: FDO_DISTRIBUTION_PACKAGES: 'git gcc g++ meson automake autoconf libtool make pkgconfig python3 check-dev valgrind binutils doxygen xz linux-headers' -# Pulls in the qemu container from upstream or rebuilds it if missing -.fedora:33@qemu-prep: - extends: - - .fedora:33 - - .fedora.packages - - .fdo.qemu-build@fedora - stage: prep - tags: - - kvm - variables: - GIT_STRATEGY: none - FDO_DISTRIBUTION_TAG: qemu-2021-01-04.1 - allow_failure: true - -# Always rebuilds the container -.fedora:33@qemu-forced-rebuild: - extends: - - .fedora:33@qemu-prep - variables: - FDO_FORCE_REBUILD: 1 - only: - - schedules - # Pulls in the qemu container from upstream or rebuilds it if missing .fedora:32@qemu-prep: extends: @@ -271,7 +248,6 @@ check-merge-request: only: - schedules - # This is the actual job fedora:32@qemu-prep: extends: .fedora:32@qemu-prep diff --git a/.gitlab-ci/ci.template b/.gitlab-ci/ci.template index cfeeb0e..de4c6b8 100644 --- a/.gitlab-ci/ci.template +++ b/.gitlab-ci/ci.template @@ -144,9 +144,8 @@ check-merge-request: {% endfor %} -{% for distro in distributions %} -{% if distro.want_qemu %} -{% for version in distro.versions %} +{% for distro in distributions if distro.want_qemu %} +{% set version = "{}".format(distro.versions|last()) %} # Pulls in the qemu container from upstream or rebuilds it if missing .{{ distro.name }}:{{ version }}@qemu-prep: extends: @@ -170,16 +169,13 @@ check-merge-request: only: - schedules -{% endfor %} -{% endif %} -{% endfor %} - # This is the actual job -fedora:32@qemu-prep: - extends: .fedora:32@qemu-prep +{{distro.name}}:{{version}}@qemu-prep: + extends: .{{distro.name}}:{{version}}@qemu-prep -fedora:32@qemu-forced-rebuild: - extends: .fedora:32@qemu-forced-rebuild +{{distro.name}}:{{version}}@qemu-forced-rebuild: + extends: .{{distro.name}}:{{version}}@qemu-forced-rebuild +{% endfor %} {% for distro in distributions %} {% for version in distro.versions %} @@ -438,9 +434,11 @@ soname: exit 1 ; fi -.qemu@fedora:32: +{% for distro in distributions if distro.want_qemu %} +{% set version = "{}".format(distro.versions|last()) %} +.qemu@{{distro.name}}:{{version}}: extends: - - .fedora:32 + - .{{distro.name}}:{{version}} stage: VM image: $CI_REGISTRY_IMAGE/$FDO_DISTRIBUTION_NAME/$FDO_DISTRIBUTION_VERSION:qemu-$FDO_DISTRIBUTION_TAG tags: @@ -485,15 +483,16 @@ soname: retry: max: 2 when: script_failure - needs: ['fedora:32@qemu-prep'] + needs: ['{{distro.name}}:{{version}}@qemu-prep'] qemu:meson: - extends: .qemu@fedora:32 + extends: .qemu@{{distro.name}}:{{version}} qemu:meson:valgrind: - extends: .qemu@fedora:32 + extends: .qemu@{{distro.name}}:{{version}} variables: MESON_TEST_ARGS: '--setup=valgrind' +{% endfor %} meson-from-tarball: extends: diff --git a/.gitlab-ci/config.yml b/.gitlab-ci/config.yml index f49fd1e..720385a 100644 --- a/.gitlab-ci/config.yml +++ b/.gitlab-ci/config.yml @@ -8,6 +8,7 @@ distributions: - name: fedora tag: *default_tag + want_qemu: true versions: - '33' - '32' @@ -28,7 +29,6 @@ distributions: - doxygen - xz - clang-analyzer - want_qemu: true - name: ubuntu tag: *default_tag versions: