.gitlab-ci.yml 4.98 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 6 7
stages:
 - build
 - test
 - package
8
 - test-package
Guido Gunther's avatar
Guido Gunther committed
9

10
variables:
11
  DEPS: build-essential git wget lcov
12 13
  WANT_BUILD_DEPS: "true"

14
# For the smoke tests we also want debug packages, phoc,
15 16 17
# weston-info, gdb, valgrind, ...
.smoketest_vars:
  variables: &smoketest_vars
18
    DEPS: phoc wget gnome-session gdb weston valgrind
19
          libhandy-0.0-0-dbgsym libgtk-3-0-dbgsym libglib2.0-0-dbgsym
20
          dconf-gsettings-backend-dbgsym
21
          xvfb imagemagick
22
    WANT_BUILD_DEPS: "false"
23

24
before_script:
25 26
  - export DEBIAN_FRONTEND=noninteractive
  - apt-get -y update
27
  - apt-get -y install wget ca-certificates gnupg eatmydata
28 29
  - echo "deb http://ci.puri.sm/ scratch librem5" > /etc/apt/sources.list.d/ci.list
  - wget -O- https://ci.puri.sm/ci-repo.key | apt-key add -
30
  - echo "deb http://debug.mirrors.debian.org/debian-debug/ buster-debug main" > /etc/apt/sources.list.d/debug.list
31
  - eatmydata apt-get -y update
32
  - '[ "$WANT_BUILD_DEPS" != "true" ] || eatmydata apt-get -y build-dep .'
33
  - eatmydata apt-get -y install $DEPS
34
  - ulimit -c unlimited
35

36
.tags: &tags
37 38
  tags:
    - librem5
39

40
build:native-debian-buster:
41 42
  <<: *tags
  stage: build
43
  image: debian:buster
44 45 46
  artifacts:
    paths:
      - _build
47
  script:
Guido Gunther's avatar
Guido Gunther committed
48
    - git submodule update --recursive
49
    - meson -Db_coverage=true --werror . _build
50
    - ninja -C _build
51

52
unit-test:native-debian-buster:
53 54
  <<: *tags
  stage: test
55
  image: debian:buster
56
  dependencies:
57
    - build:native-debian-buster
58 59
  script:
    - export LC_ALL=C.UTF-8
60
    - xvfb-run ninja -C _build test coverage
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
  coverage: '/^\s+lines\.+:\s+([\d.]+\%)\s+/'
  artifacts:
    when: always
    paths:
      - _build

build:native-debian-bullseye:
  <<: *tags
  stage: build
  image: debian:bullseye
  artifacts:
    paths:
      - _build
  script:
    - git submodule update --recursive
    - meson -Db_coverage=true --werror . _build
    - ninja -C _build

unit-test:native-debian-bullseye:
  <<: *tags
  stage: test
  image: debian:bullseye
  dependencies:
    - build:native-debian-bullseye
  script:
    - export LC_ALL=C.UTF-8
    - xvfb-run ninja -C _build test coverage
88 89 90 91 92
  coverage: '/^\s+lines\.+:\s+([\d.]+\%)\s+/'
  artifacts:
    when: always
    paths:
      - _build
93

94 95 96 97 98 99 100
build:native-alpinelinux-edge:
  <<: *tags
  stage: build
  image: alpine:edge
  allow_failure: true
  before_script:
    - apk -q add alpine-sdk
Mohammed Sadiq's avatar
Mohammed Sadiq committed
101
    - apk -q add meson ninja gtk+3.0-dev gnome-desktop-dev libhandy-dev gcr-dev upower-dev linux-pam-dev git pulseaudio-dev networkmanager-dev polkit-elogind-dev libsecret-dev
102 103 104 105 106
  artifacts:
    paths:
      - _build
  script:
    - git submodule update --recursive
107
    - meson --werror . _build
108 109 110 111 112 113 114 115 116 117 118
    - ninja -C _build

unit-test:native-alpinelinux-edge:
  <<: *tags
  stage: test
  image: alpine:edge
  allow_failure: true
  dependencies:
    - build:native-alpinelinux-edge
  before_script:
    - apk -q add alpine-sdk
Mohammed Sadiq's avatar
Mohammed Sadiq committed
119
    - apk -q add xvfb-run meson ninja glib-dev wayland-protocols wayland-dev musl-dev gnome-desktop-dev libhandy-dev gcr-dev upower-dev linux-pam-dev pulseaudio-dev networkmanager-dev polkit-elogind-dev libsecret-dev gcovr
120 121 122 123 124 125 126 127
  script:
    - export LC_ALL=C.UTF-8
    - xvfb-run ninja -C _build test
  artifacts:
    when: always
    paths:
      - _build

128 129 130
test:smoke:one-output:
  <<: *tags
  stage: test
131
  image: debian:buster
132
  variables: *smoketest_vars
133
  dependencies:
134
    - build:native-debian-buster
135
  script:
136
    - export OUTDIR=output
137 138 139
    - export G_DEBUG=fatal-criticals
    - export WLR_X11_OUTPUTS=1
    - tests/smoke
140 141 142
  artifacts:
    paths:
      - output/*.log
143
      - output/*.png
144
    when: always
145 146 147 148

test:smoke:two-outputs:
  <<: *tags
  stage: test
149
  image: debian:buster
150
  variables: *smoketest_vars
151
  dependencies:
152
    - build:native-debian-buster
153
  script:
154
    - export OUTDIR=output
155 156 157
    - export G_DEBUG=fatal-criticals
    - export WLR_X11_OUTPUTS=2
    - tests/smoke
158 159 160
  artifacts:
    paths:
      - output/*.log
161
      - output/*.png
162
    when: always
163

164
package:deb-debian-buster:
165
  extends: .l5-build-debian-package
166

167 168 169 170 171
package:deb-debian-buster:arm64:
  tags:
    - librem5:arm64
  extends: .l5-build-debian-package

172
package:deb-pureos-amber:
173 174 175
  variables:
    L5_DOCKER_IMAGE: pureos/amber
    L5_ADD_SCRATCH_CI: 'false'
176 177 178 179 180 181 182 183 184
  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 .
    - apt-get -y install build-essential git
    - git submodule update --recursive
185 186 187 188 189 190 191 192 193 194 195 196
  extends: .l5-build-debian-package

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