Imported Upstream version 2.74.0
[platform/upstream/glib-networking.git] / .gitlab-ci.yml
1 include:
2  - remote: 'https://gitlab.freedesktop.org/freedesktop/ci-templates/-/raw/c5626190ec14b475271288dda7a7dae8dbe0cd76/templates/fedora.yml'
3
4 variables:
5   FDO_UPSTREAM_REPO: GNOME/glib-networking
6
7 stages:
8   - prepare
9   - build
10
11 .fedora.container.common:
12   variables:
13     FDO_DISTRIBUTION_TAG: '2022-08-05.3'
14     FDO_DISTRIBUTION_VERSION: 'latest'
15
16 build.container.fedora@x86_64:
17   extends:
18   - '.fdo.container-build@fedora'
19   - '.fedora.container.common'
20   stage: prepare
21   variables:
22     GIT_STRATEGY: none
23     FDO_EXPIRES_AFTER: 8w
24     FDO_DISTRIBUTION_PACKAGES: >-
25       ca-certificates
26       clang-analyzer
27       gcc
28       gettext
29       git
30       lcov
31       libasan
32       meson
33       pkgconfig(gnutls)
34       pkgconfig(gsettings-desktop-schemas)
35       pkgconfig(libproxy-1.0)
36       pkgconfig(openssl)
37       pkgconfig(p11-kit-1)
38     FDO_DISTRIBUTION_EXEC: >-
39       git clone --depth=1 https://gitlab.gnome.org/GNOME/glib.git &&
40       pushd glib &&
41       meson _build --prefix=/usr &&
42       meson install -C _build &&
43       popd &&
44       rm -rf glib
45
46 fedora-x86_64:
47   extends:
48     - '.fdo.distribution-image@fedora'
49     - '.fedora.container.common'
50   stage: build
51   variables:
52     # Remove for PKCS11 logs, otherwise generates a lot of noise hitting gitlab's limit
53     PKCS11SPY_PATH: disabled
54   script:
55     - cp .gitlab-ci/lcovrc ~/.lcovrc
56     - meson setup --prefix=$HOME/glib-networking-installed
57         --fatal-meson-warnings
58         -Db_coverage=true
59         -Dgnutls=enabled
60         -Dopenssl=enabled
61         -Denvironment_proxy=enabled
62         -Dlibproxy=enabled
63         -Dgnome_proxy=enabled
64         -Ddebug_logs=true
65         -Dwerror=true
66         _build/
67     - meson compile -C _build/
68     - meson test -v -C _build/ --repeat=10
69     - meson install -C _build/
70     - ninja -C _build/ coverage-html
71   artifacts:
72     paths:
73       - _build/test-results
74       - _build/meson-logs/coveragereport
75     when: always
76   coverage: '/^\s+lines\.+:\s+([\d.]+\%)\s+/'
77
78 fedora-x86_64-asan:
79   extends:
80     - '.fdo.distribution-image@fedora'
81     - '.fedora.container.common'
82   tags: [ asan ]
83   stage: build
84   variables:
85     PKCS11SPY_PATH: disabled
86     ASAN_OPTIONS: fast_unwind_on_malloc=0
87   script:
88     - meson -Db_sanitize=address
89             -Dgnutls=enabled
90             -Dopenssl=enabled
91             -Dlibproxy=enabled
92             -Denvironment_proxy=enabled
93             -Dgnome_proxy=enabled
94             -Ddebug_logs=true
95             -Dwerror=true
96             _build/
97     - meson compile -C _build/
98     - meson test --verbose --timeout-multiplier=10 -C _build/
99   artifacts:
100     paths:
101       - _build/test-results
102     when: on_failure
103
104 fedora-x86_64-scan-build:
105   extends:
106     - '.fdo.distribution-image@fedora'
107     - '.fedora.container.common'
108   stage: build
109   script:
110     - meson -Dgnutls=enabled
111             -Dopenssl=enabled
112             -Denvironment_proxy=enabled
113             -Dlibproxy=enabled
114             -Dgnome_proxy=enabled
115             -Ddebug_logs=true
116             -Dwerror=true
117             _build/
118     - scan-build meson compile -C _build/
119     - bash -c 'if [[ -n "$(ls -A _build/meson-logs/scanbuild/)" ]]; then echo "Scan build log found, assuming defects exist"; exit 1; fi'
120   artifacts:
121     paths:
122       - _build/meson-logs/scanbuild
123     when: on_failure
124
125 vs2017-x64:
126   stage: build
127   except:
128     - tags
129   tags:
130     - win32-ps
131   script:
132     - .gitlab-ci/test-msvc.bat
133   artifacts:
134     paths:
135       - build/test-results
136     when: on_failure