gitlab CI: split the qemu meson build parts out as separate template
authorPeter Hutterer <peter.hutterer@who-t.net>
Mon, 26 Jul 2021 01:03:03 +0000 (11:03 +1000)
committerPeter Hutterer <peter.hutterer@who-t.net>
Tue, 27 Jul 2021 23:46:17 +0000 (09:46 +1000)
This was part of the test-suite-vm template but to make it easily
re-usable split out the parts that are just about building in a qemu
image from the parts that are specific to running the test suites.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
.gitlab-ci.yml
.gitlab-ci/ci.template

index 65e9bb5ca1757b183fd730c7756217fabb580fb1..be953364f13b7c49d1ebe044e0603e574504e9db 100644 (file)
@@ -455,24 +455,15 @@ freebsd:11.2@container-clean:
     exit 1 ;
   fi
 
-# Run in a test suite. Special variables:
-# - SUITES: the meson test suites to run, or
-# - SUITE_NAMES: all elements will be expanded to libinput-test-suite-$value
-# Set one or the other, not both.
-.test-suite-vm:
+# Run meson and meson test in the qemu image
+.build-in-qemu@template:
   extends:
     - .policy
     - .fdo.distribution-image@fedora
-  stage: test-suite
   tags:
     - kvm
   variables:
     MESON_BUILDDIR: build_dir
-    # remove the global --no-suite=hardware
-    MESON_TEST_ARGS: ''
-  before_script:
-    - if ! [[ -z $SUITE_NAMES ]]; then SUITES=$(echo $SUITE_NAMES | sed 's/\([^ ]*\)/libinput-test-suite-\1/g'); fi
-    - echo "Testing $SUITES"
   script:
     # start our vm, no args required
     - /app/vmctl start || (echo "Error - Failed to start the VM." && exit 1)
@@ -509,6 +500,21 @@ freebsd:11.2@container-clean:
     reports:
       junit: $MESON_BUILDDIR/junit-*.xml
 
+
+# Run in a test suite. Special variables:
+# - SUITES: the meson test suites to run, or
+# - SUITE_NAMES: all elements will be expanded to libinput-test-suite-$value
+# Set one or the other, not both.
+.test-suite-vm:
+  extends:
+    - .build-in-qemu@template
+  stage: test-suite
+  variables:
+    # remove the global --no-suite=hardware
+    MESON_TEST_ARGS: ''
+  before_script:
+    - if ! [[ -z $SUITE_NAMES ]]; then SUITES=$(echo $SUITE_NAMES | sed 's/\([^ ]*\)/libinput-test-suite-\1/g'); fi
+    - echo "Testing $SUITES"
   retry:
     max: 2
     when: script_failure
index d7950913b93869f2f4034cb5adcddbc0b2ab1c89..f8a781ea7581a6b739510cf5cddc95c4eab1cd9c 100644 (file)
@@ -335,24 +335,15 @@ freebsd:11.2@container-clean:
     exit 1 ;
   fi
 
-# Run in a test suite. Special variables:
-# - SUITES: the meson test suites to run, or
-# - SUITE_NAMES: all elements will be expanded to libinput-test-suite-$value
-# Set one or the other, not both.
-.test-suite-vm:
+# Run meson and meson test in the qemu image
+.build-in-qemu@template:
   extends:
     - .policy
     - .fdo.distribution-image@fedora
-  stage: test-suite
   tags:
     - kvm
   variables:
     MESON_BUILDDIR: build_dir
-    # remove the global --no-suite=hardware
-    MESON_TEST_ARGS: ''
-  before_script:
-    - if ! [[ -z $SUITE_NAMES ]]; then SUITES=$(echo $SUITE_NAMES | sed 's/\([^ ]*\)/libinput-test-suite-\1/g'); fi
-    - echo "Testing $SUITES"
   script:
     # start our vm, no args required
     - /app/vmctl start || (echo "Error - Failed to start the VM." && exit 1)
@@ -389,6 +380,21 @@ freebsd:11.2@container-clean:
     reports:
       junit: $MESON_BUILDDIR/junit-*.xml
 
+
+# Run in a test suite. Special variables:
+# - SUITES: the meson test suites to run, or
+# - SUITE_NAMES: all elements will be expanded to libinput-test-suite-$value
+# Set one or the other, not both.
+.test-suite-vm:
+  extends:
+    - .build-in-qemu@template
+  stage: test-suite
+  variables:
+    # remove the global --no-suite=hardware
+    MESON_TEST_ARGS: ''
+  before_script:
+    - if ! [[ -z $SUITE_NAMES ]]; then SUITES=$(echo $SUITE_NAMES | sed 's/\([^ ]*\)/libinput-test-suite-\1/g'); fi
+    - echo "Testing $SUITES"
   retry:
     max: 2
     when: script_failure