.gitlab-ci.yml 8.41 KB
Newer Older
1 2 3
include:
 - 'https://source.puri.sm/Librem5/librem5-ci/raw/master/librem5-pipeline-definitions.yml'

Guido Gunther's avatar
Guido Gunther committed
4 5
stages:
 - build
6
 - test+docs
Guido Gunther's avatar
Guido Gunther committed
7
 - package
8
 - test-package
Guido Gunther's avatar
Guido Gunther committed
9

10
variables:
11
  DEPS: build-essential git wget lcov
12
  WANT_BUILD_DEPS: "true"
13
  XVFB_RUN: xvfb-run -a -s -noreset
14 15 16 17 18 19 20 21 22 23
  COMMON_BUILD_OPTS: -Db_coverage=true --werror

.buster_vars: &buster_vars
  variables:
    CI_REPO: "deb http://ci.puri.sm/ scratch librem5"
    DIST: buster
    BUILD_OPTS: -Dphoc_tests=disabled -Dgtk_doc=false ${COMMON_BUILD_OPTS}

.bullseye_vars: &bullseye_vars
  variables:
24
    CI_REPO: "deb http://ci.puri.sm/ bullseyeci main"
25 26 27 28 29 30 31 32 33 34 35 36 37 38
    DIST: bullseye
    BUILD_OPTS: -Dphoc_tests=enabled -Dgtk_doc=true ${COMMON_BUILD_OPTS}

.build_step: &build_step
  script:
    - git submodule update --recursive
    - 'echo "Build opts: ${BUILD_OPTS}"'
    - meson ${BUILD_OPTS} . _build
    - ninja -C _build

.test_step: &test_step
  script:
    - export LC_ALL=C.UTF-8
    - ${XVFB_RUN} ninja -C _build test
39
    - ninja -C _build coverage
40

41
# For the smoke tests we also want debug packages, phoc,
42 43 44
# weston-info, gdb, valgrind, ...
.smoketest_vars:
  variables: &smoketest_vars
45 46
    CI_REPO: "deb http://ci.puri.sm/ scratch librem5"
    DIST: buster
47
    DEPS: phoc wget gnome-session-bin gdb weston valgrind
48
          libhandy-1-0-dbgsym libgtk-3-0-dbgsym libglib2.0-0-dbgsym
49
          dconf-gsettings-backend-dbgsym libfeedback-0.0-0-dbgsym
50
          xvfb imagemagick
51
    WANT_BUILD_DEPS: "false"
52

53

54
before_script:
55 56
  - export DEBIAN_FRONTEND=noninteractive
  - apt-get -y update
57
  - apt-get -y install wget ca-certificates gnupg eatmydata
58 59
  - echo "Using CI repo ${CI_REPO}"
  - echo "$CI_REPO" > /etc/apt/sources.list.d/ci.list
60
  - wget -O- https://ci.puri.sm/ci-repo.key | apt-key add -
61
  - echo "deb http://debug.mirrors.debian.org/debian-debug/ ${DIST}-debug main" > /etc/apt/sources.list.d/debug.list
62
  - eatmydata apt-get -y update
63
  - '[ "$WANT_BUILD_DEPS" != "true" ] || eatmydata apt-get -y build-dep .'
64
  - eatmydata apt-get -y install $DEPS
65
  - ulimit -c unlimited
66

67
.tags: &tags
68 69
  tags:
    - librem5
70

71
build:native-debian-buster:
72 73
  <<: *tags
  stage: build
74
  image: debian:buster
75 76
  <<: *buster_vars
  <<: *build_step
77 78 79
  artifacts:
    paths:
      - _build
80 81 82
  except:
    variables:
      - $PKG_ONLY == "1"
83

84
unit-test:native-debian-buster:
85
  <<: *tags
86
  stage: test+docs
87
  image: debian:buster
88
  dependencies:
89
    - build:native-debian-buster
90 91
  <<: *buster_vars
  <<: *test_step
92 93 94 95 96
  coverage: '/^\s+lines\.+:\s+([\d.]+\%)\s+/'
  artifacts:
    when: always
    paths:
      - _build
97 98 99
  except:
    variables:
      - $PKG_ONLY == "1"
100 101 102 103 104

build:native-debian-bullseye:
  <<: *tags
  stage: build
  image: debian:bullseye
105 106
  <<: *bullseye_vars
  <<: *build_step
107 108 109
  artifacts:
    paths:
      - _build
110 111 112
  except:
    variables:
      - $PKG_ONLY == "1"
113

114 115 116 117 118 119 120 121 122 123 124 125
build:cross-debian-bullseye:i386:
  <<: *tags
  stage: build
  image: debian:bullseye
  allow_failure: true
  before_script:
    - export DEBIAN_FRONTEND=noninteractive
    - echo "deb [arch=i386] http://deb.debian.org/debian/ testing main" > /etc/apt/sources.list.d/i386.list
    - apt-get -y update
    - apt-get -y install eatmydata
    - dpkg --add-architecture i386
    - eatmydata apt-get -y update
126
    - eatmydata apt-get -y -a i386 -o APT::Immediate-Configure=false build-dep .
127 128 129 130 131 132 133 134 135 136 137 138 139 140
    - eatmydata apt-get -y install $DEPS crossbuild-essential-i386
  script:
    - git submodule update --recursive
    - 'echo "Build opts: ${BUILD_OPTS}"'
    - /usr/share/meson/debcrossgen --arch i386 -o cross-i386.txt
    - meson ${BUILD_OPTS} . _build --cross-file cross-i386.txt
    - ninja -C _build
  artifacts:
    paths:
      - _build
  except:
    variables:
      - $PKG_ONLY == "1"

141 142
unit-test:native-debian-bullseye:
  <<: *tags
143
  stage: test+docs
144 145 146
  image: debian:bullseye
  dependencies:
    - build:native-debian-bullseye
147 148
  <<: *bullseye_vars
  <<: *test_step
149 150 151 152 153
  coverage: '/^\s+lines\.+:\s+([\d.]+\%)\s+/'
  artifacts:
    when: always
    paths:
      - _build
154 155 156
  except:
    variables:
      - $PKG_ONLY == "1"
157

158 159 160 161 162 163
build-gtkdoc:
  <<: *tags
  image: debian:bullseye
  stage: test+docs
  dependencies:
    - build:native-debian-bullseye
164
  <<: *bullseye_vars
165
  script:
166
    - tools/doc-check
167 168 169 170
    - mv _build/docs/html/ _reference/
  artifacts:
    paths:
      - _reference
171 172 173
  except:
    variables:
      - $PKG_ONLY == "1"
174

175 176
check-po:
  <<: *tags
177
  stage: test+docs
178 179 180 181 182 183
  image: debian:bullseye
  dependencies:
    - build:native-debian-bullseye
  before_script:
    - apt-get -y update
    - apt-get -y install intltool
184
  <<: *bullseye_vars
185 186 187 188 189 190
  script:
    # barf on untranslated C files. Seems intltool
    # can't be told to exit with non-zero exit status
    # in this case
    - cd po/
    - intltool-update -m 2>&1 | grep -qs '/.*\.c' && { intltool-update -m; exit 1; } || exit 0
191 192 193
  except:
    variables:
      - $PKG_ONLY == "1"
194

Zander Brown's avatar
Zander Brown committed
195 196 197 198 199 200 201 202 203 204 205 206 207 208 209
check-license-headers:
  <<: *tags
  stage: test+docs
  image: debian:bullseye
  dependencies:
    - build:native-debian-bullseye
  <<: *bullseye_vars
  script:
    # Checks .c and .h files begin with a license header as
    # defined in HACKING.md
    - ./tools/check-license-headers.py
  except:
    variables:
      - $PKG_ONLY == "1"

210 211 212 213 214 215
build:native-alpinelinux-edge:
  <<: *tags
  stage: build
  image: alpine:edge
  allow_failure: true
  before_script:
216
    - echo "https://alpine.global.ssl.fastly.net/alpine/edge/testing" >> /etc/apk/repositories
217
    - apk -q add alpine-sdk
218
    - apk -q add meson ninja gtk+3.0-dev gnome-desktop-dev libhandy1-dev gcr-dev upower-dev linux-pam-dev git pulseaudio-dev networkmanager-dev polkit-elogind-dev libsecret-dev feedbackd-dev
219 220 221 222 223
  artifacts:
    paths:
      - _build
  script:
    - git submodule update --recursive
224
    - meson --werror . _build
225
    - ninja -C _build
226 227 228
  except:
    variables:
      - $PKG_ONLY == "1"
229 230 231

unit-test:native-alpinelinux-edge:
  <<: *tags
232
  stage: test+docs
233 234 235 236 237
  image: alpine:edge
  allow_failure: true
  dependencies:
    - build:native-alpinelinux-edge
  before_script:
238
    - echo "https://alpine.global.ssl.fastly.net/alpine/edge/testing" >> /etc/apk/repositories
239
    - apk -q add alpine-sdk
240
    - apk -q add xvfb-run meson ninja glib-dev wayland-protocols wayland-dev musl-dev gnome-desktop-dev libhandy1-dev gcr-dev upower-dev linux-pam-dev pulseaudio-dev networkmanager-dev polkit-elogind-dev libsecret-dev gcovr feedbackd-dev
241 242
  script:
    - export LC_ALL=C.UTF-8
243
    - ${XVFB_RUN} ninja -C _build test
244 245 246 247
  artifacts:
    when: always
    paths:
      - _build
248 249 250
  except:
    variables:
      - $PKG_ONLY == "1"
251

252 253
test:smoke:one-output:
  <<: *tags
254
  stage: test+docs
255
  image: debian:buster
256
  variables: *smoketest_vars
257
  dependencies:
258
    - build:native-debian-buster
259
  script:
260
    - export OUTDIR=output
261 262 263
    - export G_DEBUG=fatal-criticals
    - export WLR_X11_OUTPUTS=1
    - tests/smoke
264 265 266
  artifacts:
    paths:
      - output/*.log
267
      - output/*.png
268
    when: always
269 270 271
  except:
    variables:
      - $PKG_ONLY == "1"
272 273 274

test:smoke:two-outputs:
  <<: *tags
275
  stage: test+docs
276
  image: debian:buster
277
  variables: *smoketest_vars
278
  dependencies:
279
    - build:native-debian-buster
280
  script:
281
    - export OUTDIR=output
282 283 284
    - export G_DEBUG=fatal-criticals
    - export WLR_X11_OUTPUTS=2
    - tests/smoke
285 286 287
  artifacts:
    paths:
      - output/*.log
288
      - output/*.png
289
    when: always
290 291 292
  except:
    variables:
      - $PKG_ONLY == "1"
293

294
package:deb-debian-buster:
295
  extends: .l5-build-debian-package
296 297 298 299 300

package:deb-debian-bullseye:arm64:
  tags:
    - librem5:arm64
  variables:
301
    L5_DOCKER_IMAGE: debian:bullseye
302 303
    L5_ADD_SCRATCH_CI: 'false'
  extends: .l5-build-debian-package
304

305 306 307 308 309
package:deb-debian-buster:arm64:
  tags:
    - librem5:arm64
  extends: .l5-build-debian-package

310
package:deb-pureos-amber:
311 312 313
  variables:
    L5_DOCKER_IMAGE: pureos/amber
    L5_ADD_SCRATCH_CI: 'false'
314 315 316 317 318 319 320
  before_script:
    - export DEBIAN_FRONTEND=noninteractive
    - echo "man-db man-db/auto-update boolean false" | debconf-set-selections
    - echo "deb https://repo.pureos.net/pureos amber-phone-staging main" > /etc/apt/sources.list.d/staging.list
    - echo "deb https://repo.pureos.net/pureos amber-proposed-updates main" >> /etc/apt/sources.list.d/staging.list
    - apt-get -y update
    - apt-get -y build-dep .
321
    - apt-get -y install build-essential git devscripts
322
    - git submodule update --recursive
323
  extends: .l5-build-debian-package
324
  allow_failure: true
325 326 327 328 329 330 331 332 333 334 335

autopkgtest-debian-buster-package:
  dependencies:
    - package:deb-debian-buster
  extends: .l5-autopkgtest-debian-package

lintian-debian-buster-package:
  dependencies:
    - package:deb-debian-buster
  extends: .l5-lintian-debian-package