diff mbox series

[libdrm] gitlab-ci: use variables to deduplicate the build commands

Message ID 20180906134024.8445-1-eric.engestrom@intel.com (mailing list archive)
State New, archived
Headers show
Series [libdrm] gitlab-ci: use variables to deduplicate the build commands | expand

Commit Message

Eric Engestrom Sept. 6, 2018, 1:40 p.m. UTC
Signed-off-by: Eric Engestrom <eric.engestrom@intel.com>
---
 .gitlab-ci.yml | 129 ++++++++++++++++++-------------------------------
 1 file changed, 47 insertions(+), 82 deletions(-)

Comments

Emil Velikov Sept. 6, 2018, 3:01 p.m. UTC | #1
On 6 September 2018 at 14:40, Eric Engestrom <eric.engestrom@intel.com> wrote:
> Signed-off-by: Eric Engestrom <eric.engestrom@intel.com>
> ---
>  .gitlab-ci.yml | 129 ++++++++++++++++++-------------------------------
>  1 file changed, 47 insertions(+), 82 deletions(-)
>
> diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
> index eee6abfcdd7de2839660..1dc434a5d359b3b077e7 100644
> --- a/.gitlab-ci.yml
> +++ b/.gitlab-ci.yml
> @@ -1,3 +1,46 @@
> +.meson-build: &meson-build

Gitlab calls these templates, not variables. With that fixed
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>

-Emil
Eric Engestrom Sept. 6, 2018, 4:01 p.m. UTC | #2
On Thursday, 2018-09-06 16:01:15 +0100, Emil Velikov wrote:
> On 6 September 2018 at 14:40, Eric Engestrom <eric.engestrom@intel.com> wrote:
> > Signed-off-by: Eric Engestrom <eric.engestrom@intel.com>
> > ---
> >  .gitlab-ci.yml | 129 ++++++++++++++++++-------------------------------
> >  1 file changed, 47 insertions(+), 82 deletions(-)
> >
> > diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
> > index eee6abfcdd7de2839660..1dc434a5d359b3b077e7 100644
> > --- a/.gitlab-ci.yml
> > +++ b/.gitlab-ci.yml
> > @@ -1,3 +1,46 @@
> > +.meson-build: &meson-build
> 
> Gitlab calls these templates, not variables. With that fixed
> Reviewed-by: Emil Velikov <emil.velikov@collabora.com>

Thanks, I should've looked that up :]
Fixed and pushed.

> 
> -Emil
diff mbox series

Patch

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index eee6abfcdd7de2839660..1dc434a5d359b3b077e7 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -1,3 +1,46 @@ 
+.meson-build: &meson-build
+  - meson _build
+      -D amdgpu=true
+      -D cairo-tests=true
+      -D etnaviv=true
+      -D exynos=true
+      -D freedreno=true
+      -D freedreno-kgsl=true
+      -D intel=true
+      -D libkms=true
+      -D man-pages=true
+      -D nouveau=true
+      -D omap=true
+      -D radeon=true
+      -D tegra=true
+      -D udev=true
+      -D valgrind=true
+      -D vc4=true
+      -D vmwgfx=true
+  - ninja -C _build
+  - ninja -C _build test
+
+.autotools-build: &autotools-build
+  - mkdir _build
+  - cd _build
+  - ../autogen.sh
+      --enable-udev
+      --enable-libkms
+      --enable-intel
+      --enable-radeon
+      --enable-admgpu
+      --enable-nouveau
+      --enable-vmwfgx
+      --enable-omap-experimental-api
+      --enable-exynos-experimental-api
+      --enable-freedreno
+      --enable-freedreno-kgsl
+      --enable-tegra-experimental-api
+      --enable-vc4
+      --enable-etnaviv-experimental-api
+  - make
+  - make check
+
 latest-meson:
   stage: build
   image: base/archlinux:latest
@@ -10,27 +53,7 @@  latest-meson:
         valgrind
         libatomic_ops
         cairo cunit
-  script:
-    - meson _build
-        -D amdgpu=true
-        -D cairo-tests=true
-        -D etnaviv=true
-        -D exynos=true
-        -D freedreno=true
-        -D freedreno-kgsl=true
-        -D intel=true
-        -D libkms=true
-        -D man-pages=true
-        -D nouveau=true
-        -D omap=true
-        -D radeon=true
-        -D tegra=true
-        -D udev=true
-        -D valgrind=true
-        -D vc4=true
-        -D vmwgfx=true
-    - ninja -C _build
-    - ninja -C _build test
+  script: *meson-build
 
 latest-autotools:
   stage: build
@@ -45,26 +68,7 @@  latest-autotools:
         cairo cunit
         xorg-util-macros
         git # autogen.sh depends on git
-  script:
-    - mkdir _build
-    - cd _build
-    - ../autogen.sh
-        --enable-udev
-        --enable-libkms
-        --enable-intel
-        --enable-radeon
-        --enable-admgpu
-        --enable-nouveau
-        --enable-vmwfgx
-        --enable-omap-experimental-api
-        --enable-exynos-experimental-api
-        --enable-freedreno
-        --enable-freedreno-kgsl
-        --enable-tegra-experimental-api
-        --enable-vc4
-        --enable-etnaviv-experimental-api
-    - make
-    - make check
+  script: *autotools-build
 
 oldest-meson:
   stage: build
@@ -98,29 +102,9 @@  oldest-meson:
       (cd $LIBPCIACCESS_VERSION && ./configure --prefix=$HOME/prefix && make install)
     - pip3 install wheel setuptools
     - pip3 install meson==0.43
-  script:
     - export PKG_CONFIG_PATH=$HOME/prefix/lib/pkgconfig:$HOME/prefix/share/pkgconfig
     - export LD_LIBRARY_PATH="$HOME/prefix/lib:$LD_LIBRARY_PATH"
-    - meson _build
-        -D amdgpu=true
-        -D cairo-tests=true
-        -D etnaviv=true
-        -D exynos=true
-        -D freedreno=true
-        -D freedreno-kgsl=true
-        -D intel=true
-        -D libkms=true
-        -D man-pages=true
-        -D nouveau=true
-        -D omap=true
-        -D radeon=true
-        -D tegra=true
-        -D udev=true
-        -D valgrind=true
-        -D vc4=true
-        -D vmwgfx=true
-    - ninja -C _build
-    - ninja -C _build test
+  script: *meson-build
 
 oldest-autotools:
   stage: build
@@ -155,25 +139,6 @@  oldest-autotools:
       wget --no-check-certificate https://xorg.freedesktop.org/releases/individual/lib/$LIBPCIACCESS_VERSION.tar.bz2 &&
       tar -jxvf $LIBPCIACCESS_VERSION.tar.bz2 &&
       (cd $LIBPCIACCESS_VERSION && ./configure --prefix=$HOME/prefix && make install)
-  script:
     - export PKG_CONFIG_PATH=$HOME/prefix/lib/pkgconfig:$HOME/prefix/share/pkgconfig
     - export LD_LIBRARY_PATH="$HOME/prefix/lib:$LD_LIBRARY_PATH"
-    - mkdir _build
-    - cd _build
-    - ../autogen.sh
-        --enable-udev
-        --enable-libkms
-        --enable-intel
-        --enable-radeon
-        --enable-admgpu
-        --enable-nouveau
-        --enable-vmwfgx
-        --enable-omap-experimental-api
-        --enable-exynos-experimental-api
-        --enable-freedreno
-        --enable-freedreno-kgsl
-        --enable-tegra-experimental-api
-        --enable-vc4
-        --enable-etnaviv-experimental-api
-    - make
-    - make check
+  script: *autotools-build