Commit fa6dbf8c authored by Arkadiusz Hiler's avatar Arkadiusz Hiler

Add GitLab's CI/CD configuration

The CI/CD pipeline is configured the following way:
 1. Build docker images and add them to repo's registry (manual step for
    now, automation needs GitLab to be updated).
 2. Build igt with meson on Debian and Fedora.
 3. Run `ninja tests` on Fedora.
 4. Build and publish docs as an artifact, for GitLab Pages.

v2: Typos and fully-featured meson build.
v3: Use variables instead of hard-coding registry and project.

Cc: Petri Latvala <petri.latvala@intel.com>
Cc: Daniel Vetter <daniel@ffwll.ch>
Signed-off-by: Arkadiusz Hiler's avatarArkadiusz Hiler <arkadiusz.hiler@intel.com>
Acked-by: Daniel Vetter's avatarDaniel Vetter <daniel.vetter@ffwll.ch>
Acked-by: Petri Latvala's avatarPetri Latvala <petri.latvala@intel.com>
parent b633344e
Pipeline #6436 passed with stages
in 7 minutes and 20 seconds
image: registry.freedesktop.org/drm/igt-gpu-tools/igt-fedora:latest
variables:
MESON_OPTIONS: >
-Dwith_libdrm=intel,nouveau,amdgpu
-Dbuild_overlay=true
-Dbuild_audio=true
-Dbuild_chamelium=true
-Dwith_valgrind=true
-Dbuild_man=true
-Dbuild_tests=true
-Dbuild_runner=true
stages:
- containers
- build
- test
- deploy
build:tests-fedora:
stage: build
script:
# Feodora does not have peg packaged
- meson $MESON_OPTIONS build
- ninja -C build
artifacts:
paths:
- build
build:tests-debian:
image: registry.freedesktop.org/drm/igt-gpu-tools/igt-debian:latest
stage: build
script:
- meson $MESON_OPTIONS build
- ninja -C build
ninja:test:
stage: test
script:
- ninja -C build test
pages:
stage: deploy
script:
- ninja -C build igt-gpu-tools-doc
- cp -r build/docs/reference/igt-gpu-tools/html public
artifacts:
paths:
- public
only:
- master
containers:igt-debian:
stage: containers
when: manual
image: docker:stable
services:
- docker:dind
variables:
DOCKER_HOST: tcp://docker:2375
DOCKER_DRIVER: overlay2
script:
- docker login -u gitlab-ci-token -p $CI_JOB_TOKEN $CI_REGISTRY
- docker build -t $CI_REGISTRY/$CI_PROJECT_PATH/igt-debian -f Dockerfile.debian .
- docker push $CI_REGISTRY/$CI_PROJECT_PATH/igt-debian
containers:igt-fedora:
stage: containers
when: manual
image: docker:stable
services:
- docker:dind
variables:
DOCKER_HOST: tcp://docker:2375
DOCKER_DRIVER: overlay2
script:
- docker login -u gitlab-ci-token -p $CI_JOB_TOKEN $CI_REGISTRY
- docker build -t $CI_REGISTRY/$CI_PROJECT_PATH/igt-fedora -f Dockerfile.fedora .
- docker push $CI_REGISTRY/$CI_PROJECT_PATH/igt-fedora
FROM debian:stretch-backports
RUN apt-get update
RUN apt-get install -y \
gcc \
flex \
bison \
pkg-config \
libpciaccess-dev \
libkmod-dev \
libprocps-dev \
libunwind-dev \
libdw-dev \
zlib1g-dev \
liblzma-dev \
libssl-dev \
libcairo-dev \
libpixman-1-dev \
libudev-dev \
libgsl-dev \
libasound2-dev \
libxmlrpc-core-c3-dev \
libjson-c-dev \
libcurl4-openssl-dev \
libxrandr-dev \
libxv-dev \
x11proto-dri2-dev \
python-docutils \
valgrind \
peg
RUN apt-get install -t stretch-backports -y \
meson \
libdrm-dev \
libdrm-intel1
FROM fedora:28
RUN dnf install -y gcc \
flex \
meson \
bison \
gtk-doc \
xdotool \
gsl-devel \
kmod-devel \
glib2-devel \
cairo-devel \
procps-devel \
pixman-devel \
json-c-devel \
libdrm-devel \
openssl-devel \
libudev-devel \
xmlrpc-c-devel \
elfutils-devel \
libunwind-devel \
python-docutils \
libpciaccess-devel \
alsa-lib-devel \
valgrind-devel \
libXrandr-devel \
libXv-devel
# We need peg to build overlay
RUN dnf install -y make
RUN mkdir /tmp/peg
WORKDIR /tmp/peg
RUN curl -O http://piumarta.com/software/peg/peg-0.1.18.tar.gz
RUN tar xf peg-0.1.18.tar.gz
RUN cd peg-0.1.18 && make PREFIX=/usr install
RUN rm -fr /tmp/peg
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment