summaryrefslogtreecommitdiff
path: root/.gitlab-ci.yml
blob: 6b6cebc931a030af91394ea1eec06f3318367a49 (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
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
                       libdbus-1-dev libgirepository1.0-dev libglib2.0-dev
                       bash-completion lcov valac
  - export LANG=C.UTF-8

stages:
  - build
  - test
  - deploy

variables:
  MESON_TEST_TIMEOUT_MULTIPLIER: 2

build-job:
  stage: build
  script:
    - meson -Db_coverage=true -Dman=true -Dgtk_doc=true --buildtype debug --werror _build .
    - ninja -C _build all dconf-doc
  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 -Dman=true -Dgtk_doc=true
    - ninja -C _build all dconf-doc
    - 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: always
    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 -Db_coverage=true -Dgtk_doc=true _build .
    - ninja -C _build all dconf-doc
    - 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"
    - mkdir -p public/
    - mv _build/docs/html/ public/docs/
    - mv _coverage/ public/coverage/
  artifacts:
    paths:
      - public