summaryrefslogtreecommitdiff
path: root/.gitlab-ci.yml
blob: 56406096d94fc00117297a503058b3402ac214fa (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
stages:
  - build
  - deploy

variables:
  DEPENDENCIES: dbus-daemon diffutils gcc gi-docgen libsecret-devel meson ninja-build openssh openssh-clients python redhat-rpm-config systemd-devel gtk4-devel

fedora:Werror:
  image: fedora:latest
  stage: build
  before_script:
    - dnf upgrade -y
    - dnf install -y 'dnf-command(builddep)' $DEPENDENCIES
    - dnf builddep -y gcr
  script:
    - meson _build -Dwerror=true -Dc_args=-Wno-error=deprecated-declarations -Dgtk_doc=false
    - meson compile -C _build
    - dbus-run-session -- meson test -C _build
  artifacts:
    reports:
      junit: "_build/meson-logs/testlog.junit.xml"
    name: "gcr-werror-${CI_JOB_NAME}-${CI_COMMIT_REF_NAME}"
    when: always
    paths:
      - "_build/config.h"
      - "_build/meson-logs"

fedora:asan:
  image: fedora:latest
  stage: build
  tags:
    - asan # LSAN needs CAP_SYS_PTRACE
  before_script:
    - dnf upgrade -y
    - dnf install -y 'dnf-command(builddep)' $DEPENDENCIES libasan
    - dnf builddep -y gcr
  script:
    - meson _build -Db_sanitize=address -Dgtk_doc=false
    - export G_SLICE=always-malloc G_DEBUG=gc-friendly ASAN_OPTIONS=abort_on_error=1:fast_unwind_on_malloc=0
    - dbus-run-session -- meson test -C _build
  allow_failure: true
  artifacts:
    name: "gcr-asan-${CI_JOB_NAME}-${CI_COMMIT_REF_NAME}"
    when: always
    reports:
      junit: "_build/meson-logs/testlog.junit.xml"
    paths:
      - "_build/config.h"
      - "_build/meson-logs"

fedora:ubsan:
  image: fedora:latest
  stage: build
  before_script:
    - dnf upgrade -y
    - dnf install -y 'dnf-command(builddep)' $DEPENDENCIES libubsan
    - dnf builddep -y gcr
  script:
    - meson _build -Db_sanitize=undefined -Dgtk_doc=false
    - dbus-run-session -- meson test -C _build
  artifacts:
    name: "gcr-ubsan-${CI_JOB_NAME}-${CI_COMMIT_REF_NAME}"
    when: always
    reports:
      junit: "_build/meson-logs/testlog.junit.xml"
    paths:
      - "_build/config.h"
      - "_build/meson-logs"

fedora:coverage:
  image: fedora:latest
  stage: build
  before_script:
    - dnf upgrade -y
    - dnf install -y 'dnf-command(builddep)' $DEPENDENCIES lcov git gi-docgen gcovr
    - dnf builddep -y gcr
  script:
    - meson _build -Db_coverage=true
    - dbus-run-session -- meson test -C _build
    - ninja coverage-html -C _build
    - ninja coverage-xml -C _build
    - ninja docs -C _build
  coverage: '/^\s+lines.+:\s+([\d.]+\%)\s+/'
  artifacts:
    name: "gcr-coverage-${CI_JOB_NAME}-${CI_COMMIT_REF_NAME}"
    when: always
    reports:
      junit: "_build/meson-logs/testlog.junit.xml"
      coverage_report:
        coverage_format: cobertura
        path: "_build/meson-logs/coverage.xml"
    paths:
      - "_build/config.h"
      - "_build/meson-logs"
      - "_build/docs"
      - "_build/meson-logs/coveragereport"

pages:
  image: fedora:latest
  stage: deploy
  only:
    - master
  needs: ['fedora:coverage']
  before_script:
    - dnf upgrade -y
    - dnf install -y curl unzip
  script:
    - mkdir public
    - 'curl --location --output gcr-3.zip "https://gitlab.gnome.org/api/v4/projects/${CI_PROJECT_ID}/jobs/artifacts/gnome-41-ci/download?job=fedora:coverage&job_token=${CI_JOB_TOKEN}"'
    - unzip -q gcr-3.zip -d gcr-3
    - mv gcr-3/_build/docs/gck/gck-1 public/gck-1
    - mv gcr-3/_build/docs/gcr/gcr-3 public/gcr-3
    - mv gcr-3/_build/docs/ui/gcr-ui-3 public/gcr-ui-3
    - mv _build/meson-logs/coveragereport public/coverage
    - mv _build/docs/gck/gck-2 public/gck-2
    - mv _build/docs/gcr/gcr-4 public/gcr-4
  artifacts:
    when: on_success
    paths:
      - public