summaryrefslogtreecommitdiff
path: root/.gitlab-ci.yml
blob: 3bbe08f8c72783110fcdd0ee9e90379532dacfb9 (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
image: debian:unstable

before_script:
  - apt update -qq
  - apt install -y -qq build-essential meson pkg-config gtk-doc-tools
                       libxml2-utils gobject-introspection dbus dbus-x11
                       libgirepository1.0-dev libglib2.0-dev
                       lcov valac
  - export LANG=C.UTF-8

stages:
  - build
  - test
  - deploy

variables:
  MESON_TEST_TIMEOUT_MULTIPLIER: 2

build-job:
  stage: build
  script:
    - meson --buildtype debug --werror _build .
    - ninja -C _build
  except:
    - tags
  artifacts:
    when: on_failure
    name: "dconf-_${CI_COMMIT_REF_NAME}"
    paths:
      - "_build/meson-logs"

test:
  stage: test
  script:
    - meson _build . -Db_coverage=true
    - ninja -C _build
    - mkdir -p _coverage
    - lcov --rc lcov_branch_coverage=1 --directory _build --capture --initial --output-file "_coverage/${CI_JOB_NAME}-baseline.lcov"
    - meson test -C _build --timeout-multiplier ${MESON_TEST_TIMEOUT_MULTIPLIER}
    - lcov --rc lcov_branch_coverage=1 --directory _build --capture --output-file "_coverage/${CI_JOB_NAME}.lcov"
  coverage: '/^\s+lines\.+:\s+([\d.]+\%)\s+/'
  except:
    - tags
  artifacts:
    when: on_failure
    name: "dconf-_${CI_COMMIT_REF_NAME}"
    paths:
      - "_build/meson-logs"
      - "_coverage"

# FIXME: Run gtkdoc-check when we can. See:
# https://github.com/mesonbuild/meson/issues/3580

dist-job:
  stage: build
  only:
    - tags
  script:
    - meson --buildtype release _build .
    - ninja -C _build dist
  artifacts:
    paths:
      - "_build/meson-dist/dconf-*.tar.xz"

pages:
  stage: deploy
  only:
    - master
  script:
    - meson -Ddocumentation=true _build .
    - ninja -C _build dconf-doc
    - mkdir -p public/
    - mv _build/dconf/docs/html/ public/docs/
    - mv _coverage/ public/coverage/
  artifacts:
    paths:
      - public