From 98cd1c2680950aee01be0c53241bfd8d1ec04f55 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marco=20Trevisan=20=28Trevi=C3=B1o=29?= Date: Wed, 4 Dec 2019 15:38:36 +0100 Subject: [PATCH] ci: Use a docker image for builds and tests Avoid repeating the machine updates and deps installation at every stage, just reuse the docker image Registered images are at: https://gitlab.freedesktop.org/libfprint/libfprint/container_registry --- .gitlab-ci.yml | 11 +---------- .gitlab-ci/Dockerfile | 36 ++++++++++++++++++++++++++++++++++++ 2 files changed, 37 insertions(+), 10 deletions(-) create mode 100644 .gitlab-ci/Dockerfile diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 122a02e..74d4f46 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,4 +1,4 @@ -image: fedora:rawhide +image: registry.freedesktop.org/libfprint/libfprint/master:v1 stages: - check-source - build @@ -6,15 +6,11 @@ stages: - flatpack variables: - DEPENDENCIES: libgusb-devel glib2-devel nss-devel pixman-devel systemd meson gtk-doc - gcc gcc-c++ glibc-devel libX11-devel libXv-devel gtk3-devel flatpak-builder - gobject-introspection-devel python3-cairo python3-gobject umockdev BUNDLE: "org.freedesktop.libfprint.Demo.flatpak" LAST_ABI_BREAK: "056ea541ddc97f5806cffbd99a12dc87e4da3546" .build_one_driver_template: &build_one_driver script: - - dnf update -y --nogpgcheck && dnf install -y --nogpgcheck $DEPENDENCIES # Build with a driver that doesn't need imaging, or nss - meson -Ddrivers=$driver . _build - ninja -C _build @@ -22,7 +18,6 @@ variables: .build_template: &build script: - - dnf update -y --nogpgcheck && dnf install -y --nogpgcheck $DEPENDENCIES # And build with everything - meson -Ddrivers=all . _build - ninja -C _build @@ -30,7 +25,6 @@ variables: .build_template: &check_abi script: - - dnf update -y --nogpgcheck && dnf install -y --nogpgcheck $DEPENDENCIES doxygen libabigail git - ./.ci/check-abi ${LAST_ABI_BREAK} $(git rev-parse HEAD) build: @@ -44,7 +38,6 @@ build: test: stage: test script: - - dnf update -y --nogpgcheck && dnf install -y --nogpgcheck $DEPENDENCIES - meson -Ddrivers=all . _build - ninja -C _build - meson test -C _build --verbose --no-stdsplit @@ -52,7 +45,6 @@ test: test_valgrind: stage: test script: - - dnf update -y --nogpgcheck && dnf install -y --nogpgcheck $DEPENDENCIES valgrind - meson -Ddrivers=all . _build - ninja -C _build - meson test -C _build --verbose --no-stdsplit --setup=valgrind @@ -60,7 +52,6 @@ test_valgrind: test_indent: stage: check-source script: - - dnf update -y --nogpgcheck && dnf install -y --nogpgcheck git uncrustify - scripts/uncrustify.sh --check .flatpak_script_template: &flatpak_script diff --git a/.gitlab-ci/Dockerfile b/.gitlab-ci/Dockerfile new file mode 100644 index 0000000..bf0eb36 --- /dev/null +++ b/.gitlab-ci/Dockerfile @@ -0,0 +1,36 @@ +# Rebuild and push with +# +# cd .gitlab-ci/ +# docker build --no-cache -t registry.freedesktop.org/libfprint/libfprint/master:v1 . +# docker push registry.freedesktop.org/libfprint/libfprint/master:v1 +# + +FROM fedora:rawhide + +RUN dnf -y update && dnf -y upgrade && \ + dnf -y install \ + doxygen \ + flatpak-builder \ + gcc \ + gcc-c++ \ + git \ + glib2-devel \ + glibc-devel \ + gobject-introspection-devel \ + gtk-doc \ + gtk3-devel \ + libabigail \ + libgusb-devel \ + libX11-devel \ + libXv-devel \ + meson \ + nss-devel \ + pixman-devel \ + python3-cairo \ + python3-gobject \ + systemd \ + umockdev \ + uncrustify \ + valgrind \ + && \ + dnf clean all