summaryrefslogtreecommitdiff
path: root/.gitlab-ci.yml
blob: d04c4a00a6b413525128e73bbbc001c840c3d811 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
stages:
  - prebuild
  - containers
  - builds

.container_job_template: &container_job_definition
  image: docker:stable
  stage: containers
  services:
    - docker:dind
  before_script:
    - export TAG="$CI_REGISTRY_IMAGE/ci-$NAME:latest"
    - export COMMON_TAG="$CI_REGISTRY/virt-viewer/virt-viewer/ci-$NAME:latest"
    - docker info
    - docker login registry.gitlab.com -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD"
  script:
    - docker pull "$TAG" || docker pull "$COMMON_TAG" || true
    - docker build --cache-from "$TAG" --cache-from "$COMMON_TAG" --tag "$TAG" -f "ci/$NAME.Dockerfile" ci
    - docker push "$TAG"
  after_script:
    - docker logout

.git_build_job_template: &git_build_job_definition
  image: $CI_REGISTRY_IMAGE/ci-$NAME:latest
  stage: builds
  before_script:
    - export MAKEFLAGS="-j$(getconf _NPROCESSORS_ONLN)"
    - export SCRATCH_DIR="/tmp/scratch"
    - export VROOT="$SCRATCH_DIR/vroot"
    - export LD_LIBRARY_PATH="$VROOT/lib"
    - export PATH="$VROOT/bin:$PATH"
    - export PKG_CONFIG_PATH="$VROOT/lib/pkgconfig"
    - export TEST_MAINTAINER=1
  script:
    - pushd "$PWD"
    - mkdir -p "$SCRATCH_DIR"
    - cd "$SCRATCH_DIR"
    - git clone --depth 1 https://gitlab.com/libvirt/libvirt.git
    - git clone --depth 1 https://gitlab.com/libvirt/libvirt-glib.git
    - git clone --depth 1 https://gitlab.gnome.org/GNOME/gtk-vnc.git
    - cd libvirt
    - mkdir build
    - cd build
    - ../autogen.sh --prefix="$VROOT" --libdir="$VROOT/lib" --without-libvirtd
    - $MAKE install
    - cd ../../libvirt-glib
    - mkdir build
    - cd build
    - ../autogen.sh --prefix="$VROOT" --libdir="$VROOT/lib"
    - $MAKE install
    - cd ../../gtk-vnc
    - git submodule update --init
    - meson build --prefix="$VROOT" --libdir="$VROOT/lib"
    - $NINJA -C build install
    - popd
    - ./autogen.sh --prefix="$VROOT"
    - $MAKE
    - $MAKE install

# Check that all commits are signed-off for the DCO.
# Skip on "virt-viewer" namespace, since we only need to run
# this test on developer's personal forks from which
# merge requests are submitted
check-dco:
  stage: prebuild
  image: registry.gitlab.com/libvirt/libvirt-ci/check-dco:master
  script:
    - /check-dco virt-viewer
  except:
    variables:
      - $CI_PROJECT_NAMESPACE == 'virt-viewer'

centos-7-container:
  <<: *container_job_definition
  variables:
    NAME: centos-7

centos-8-container:
  <<: *container_job_definition
  variables:
    NAME: centos-8

debian-9-container:
  <<: *container_job_definition
  variables:
    NAME: debian-9

debian-10-container:
  <<: *container_job_definition
  variables:
    NAME: debian-10

debian-sid-container:
  <<: *container_job_definition
  variables:
    NAME: debian-sid

fedora-31-container:
  <<: *container_job_definition
  variables:
    NAME: fedora-31

fedora-32-container:
  <<: *container_job_definition
  variables:
    NAME: fedora-32

fedora-rawhide-container:
  <<: *container_job_definition
  variables:
    NAME: fedora-rawhide

opensuse-151-container:
  <<: *container_job_definition
  variables:
    NAME: opensuse-151

ubuntu-1804-container:
  <<: *container_job_definition
  variables:
    NAME: ubuntu-1804

ubuntu-2004-container:
  <<: *container_job_definition
  variables:
    NAME: ubuntu-2004


centos-7-git-build:
  <<: *git_build_job_definition
  variables:
    NAME: centos-7

centos-8-git-build:
  <<: *git_build_job_definition
  variables:
    NAME: centos-8

debian-9-git-build:
  <<: *git_build_job_definition
  variables:
    NAME: debian-9

debian-10-git-build:
  <<: *git_build_job_definition
  variables:
    NAME: debian-10

debian-sid-git-build:
  <<: *git_build_job_definition
  variables:
    NAME: debian-sid

fedora-31-git-build:
  <<: *git_build_job_definition
  variables:
    NAME: fedora-31

fedora-32-git-build:
  <<: *git_build_job_definition
  variables:
    NAME: fedora-32

fedora-rawhide-git-build:
  <<: *git_build_job_definition
  variables:
    NAME: fedora-rawhide

opensuse-151-git-build:
  <<: *git_build_job_definition
  variables:
    NAME: opensuse-151

ubuntu-1804-git-build:
  <<: *git_build_job_definition
  variables:
    NAME: ubuntu-1804

ubuntu-2004-git-build:
  <<: *git_build_job_definition
  variables:
    NAME: ubuntu-2004