summaryrefslogtreecommitdiff
path: root/.gitlab-ci.yml
blob: f0e988761a3c4597edb560fb60046c10f584939f (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
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
stages:
  - build
  - deploy

variables:
  DEPENDENCIES: dbus-x11 diffutils gcc gjs meson ninja-build python3-dbus python3-gobject redhat-rpm-config
  CPPCHECK_OPTIONS: "--enable=warning --enable=style --enable=performance --enable=portability --std=c99 --template='{id}:{file}:{line},{severity},{message}'"

fedora:Werror:
  image: fedora:34
  stage: build
  before_script:
    - dnf upgrade -y
    - dnf install -y 'dnf-command(builddep)'
    - dnf builddep -y libsecret
    - dnf install -y $DEPENDENCIES
    - dbus-uuidgen --ensure
  script:
    - meson _build -Dwerror=true -Dc_args=-Wno-error=deprecated-declarations -Dgtk_doc=false
    - meson compile -C _build
    - eval `dbus-launch --sh-syntax`
    - meson test -C _build
  artifacts:
    when: on_failure
    paths:
      - _build/meson-logs/testlog.txt

fedora:asan:
  image: fedora:34
  stage: build
  before_script:
    - dnf upgrade -y
    - dnf install -y 'dnf-command(builddep)'
    - dnf builddep -y libsecret
    - dnf install -y $DEPENDENCIES libasan
    - dbus-uuidgen --ensure
  script:
    - meson _build -Db_sanitize=address -Dgtk_doc=false
    - meson compile -C _build
    - eval `dbus-launch --sh-syntax`
    - meson test -C _build
  artifacts:
    when: on_failure
    paths:
      - _build/meson-logs/testlog.txt

fedora:ubsan:
  image: fedora:34
  stage: build
  before_script:
    - dnf upgrade -y
    - dnf install -y 'dnf-command(builddep)'
    - dnf builddep -y libsecret
    - dnf install -y $DEPENDENCIES libubsan
    - dbus-uuidgen --ensure
  script:
    - meson _build -Db_sanitize=undefined -Dgtk_doc=false
    - meson compile -C _build
    - eval `dbus-launch --sh-syntax`
    - meson test -C _build
  artifacts:
    when: on_failure
    paths:
      - _build/meson-logs/testlog.txt

fedora-static-analyzers/test:
  image: fedora:34
  stage: build
  before_script:
    - dnf upgrade -y
    - dnf install -y 'dnf-command(builddep)'
    - dnf builddep -y libsecret
    - dnf install -y $DEPENDENCIES clang-analyzer cppcheck
    - dbus-uuidgen --ensure
  script:
    - meson _build -Dgtk_doc=false
    - meson compile -C _build --ninja-args scan-build
    - cppcheck --force -q $CPPCHECK_OPTIONS libsecret/ egg/ tool/
  artifacts:
    when: on_failure
    paths:
      - _build/meson-logs/testlog.txt

fedora:coverage:
  image: fedora:34
  stage: build
  before_script:
    - dnf upgrade -y
    - dnf install -y 'dnf-command(builddep)'
    - dnf builddep -y libsecret
    - dnf install -y $DEPENDENCIES swtpm swtpm-tools tpm2-abrmd tpm2-tss-devel
    - dnf install -y $DEPENDENCIES lcov
    - dbus-uuidgen --ensure
  script:
    - meson _build -Db_coverage=true -Dtpm2=true -Dgtk_doc=false
    - meson compile -C _build
    - eval `dbus-launch --sh-syntax`
    - export XDG_CONFIG_HOME=$HOME/.config
    - /usr/share/swtpm/swtpm-create-user-config-files --root
    - mkdir -p ${XDG_CONFIG_HOME}/mytpm1
    - swtpm_setup --tpm2 --tpmstate $XDG_CONFIG_HOME/mytpm1 --createek --allow-signing --decryption --create-ek-cert --create-platform-cert --lock-nvram --overwrite --display
    - swtpm socket --tpm2 --tpmstate dir=$XDG_CONFIG_HOME/mytpm1 --flags startup-clear --ctrl type=tcp,port=2322 --server type=tcp,port=2321 --daemon
    - 'tpm2-abrmd --logger=stdout --tcti=swtpm: --session --allow-root --flush-all &'
    - 'export TCTI=tabrmd:bus_type=session'
    - meson test -C _build
    - ninja coverage-html -C _build
  coverage: '/^\s+lines.+:\s+([\d.]+\%)\s+/'
  artifacts:
    name: "libsecret-${CI_JOB_NAME}-${CI_COMMIT_REF_NAME}"
    when: on_success
    paths:
      - _build/meson-logs/coveragereport/
  # https://github.com/linux-test-project/lcov/issues/58
  allow_failure: true

reference:
  stage: build
  image: fedora:35
  before_script:
    - dnf install -y $DEPENDENCIES gi-docgen gobject-introspection-devel libgcrypt-devel
  variables:
    MESON_ARGS: >-
      -Dgtk_doc=true
      -Dvapi=false
      -Dmanpage=false
  script:
    - meson ${MESON_ARGS} _build
    - ninja -C _build
    - mv _build/docs/reference/libsecret/libsecret-1 _reference
  artifacts:
    paths:
      - _reference

pages:
  stage: deploy
  script:
    - mkdir public
    - mv _build/meson-logs/coveragereport public/coverage
    - mv _reference/* public/
  artifacts:
    when: on_success
    paths:
      - public
  # https://github.com/linux-test-project/lcov/issues/58
  allow_failure: true