.gitlab-ci.yml 8.12 KB
Newer Older
Olivier Crête's avatar
Olivier Crête committed
1
2
stages:
 - build
3
 - test
Olivier Crête's avatar
Olivier Crête committed
4
 - deploy
Olivier Crête's avatar
Olivier Crête committed
5

6
build autotools:
Olivier Crête's avatar
Olivier Crête committed
7
 stage: build
8
 image: registry.freedesktop.org/libnice/libnice/centos7/autotools-build
Olivier Crête's avatar
Olivier Crête committed
9
10
11
12
13
14
15
16
17
18
19
20
 except:
  - schedules
 script:
  - ifconfig
  - export BUILD_ID="libnice-$CI_JOB_NAME_$CI_COMMIT_SHA-$CI_JOB_ID"
  - export PREFIX="$(pwd)/prefix-$BUILD_ID"
  - export MAKEFLAGS="-j4"
  - mkdir "$PREFIX"
  - ./autogen.sh --prefix="$PREFIX" --enable-compile-warnings=error --enable-gtk-doc --enable-introspection
  - make
  - make install
 artifacts:
21
22
23
24
   untracked: true

test autotools:
  stage: test
25
  image: registry.freedesktop.org/libnice/libnice/centos7/autotools-build
26
27
  except:
    - schedules
28
  needs:
29
30
31
32
33
34
35
36
37
38
39
40
    - build autotools
  script:
    - ifconfig
    - make check
  artifacts:
    when: always
    paths:
      - config.log
      - nice/test-suite.log
      - random/test-suite.log
      - tests/test-suite.log
      - stun/tests/test-suite.log
41
      - docs/reference/libnice/test-suite.log
Olivier Crête's avatar
Olivier Crête committed
42

43
44
45
46
47
48
test autotools valgrind:
  extends: test autotools
  script:
    - ifconfig
    - make check-valgrind

49
50
distcheck autotools:
  stage: test
51
  image: registry.freedesktop.org/libnice/libnice/centos7/autotools-build
52
53
  except:
    - schedules
54
  needs:
55
56
57
58
59
60
61
62
    - build autotools
  script:
    - ifconfig
    - make distcheck
  artifacts:
    paths:
      - libnice-*.tar.gz

Jordan Petridіs's avatar
Jordan Petridіs committed
63
64
build meson:
  stage: build
65
  image: registry.freedesktop.org/libnice/libnice/centos7/meson-build
Jordan Petridіs's avatar
Jordan Petridіs committed
66
67
  variables:
    PREFIX: "${CI_PROJECT_DIR}/libnice-prefix"
68
69
  except:
    - schedules
Jordan Petridіs's avatar
Jordan Petridіs committed
70
71
72
  before_script:
    - mkdir -p "${CI_PROJECT_DIR}"
  script:
73
74
    ## && true to make gitlab-ci happy
    - source scl_source enable rh-python36 && true
75
    - meson --werror --warnlevel 2 -Dgtk_doc=enabled --prefix=$PREFIX build/
76
    - ninja-build -C build/
77
  artifacts:
78
79
80
    paths:
      - build/

Jordan Petridіs's avatar
Jordan Petridіs committed
81
build msys2:
Tim-Philipp Müller's avatar
Tim-Philipp Müller committed
82
  image: 'registry.freedesktop.org/gstreamer/gst-ci/amd64/windows:v10'
Jordan Petridіs's avatar
Jordan Petridіs committed
83
  stage: 'build'
84
  allow_failure: true
Jordan Petridіs's avatar
Jordan Petridіs committed
85
86
87
  tags:
    - 'docker'
    - 'windows'
88
    - '1809'
Jordan Petridіs's avatar
Jordan Petridіs committed
89
90
91
92
93
94
95
96
97
  variables:
    MESON_ARGS: >
      --prefix=${CI_PROJECT_DIR}/libnice-prefix
    # Make sure any failure in PowerShell scripts is fatal
    ErrorActionPreference: 'Stop'
    WarningPreference: 'Stop'
  before_script:
    - pip3 install -U meson
  script:
98
99
100
101
102
103
104
105
106
107
    # Make sure powershell exists on errors
    # https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_preference_variables?view=powershell-6
    - $ErrorActionPreference = "Stop"

    # For some reason docker build hangs if this is included in the image, needs more troubleshooting
    - $env:PATH += ';C:\msys64\usr\bin;C:\msys64\mingw64\bin;C:\msys64\mingw32\bin'
    - C:\msys64\usr\bin\bash -c "pacman-key --init && pacman-key --populate msys2 && pacman-key --refresh-keys || true"
    - C:\msys64\usr\bin\bash -c "pacman -Syuu --noconfirm"
    - C:\msys64\usr\bin\bash -c "pacman -Sy --noconfirm --needed mingw-w64-x86_64-toolchain ninja"

Jordan Petridіs's avatar
Jordan Petridіs committed
108
109
110
111
112
    # For some reason, options are separated by newline instead of space, so we
    # have to replace them first.
    - $env:MESON_ARGS = $env:MESON_ARGS.replace("`n"," ")

    - $env:PATH += ";C:\msys64\usr\bin;C:\msys64\mingw64/bin;C:\msys64\mingw32/bin"
113
114
115
116
117
118

    # For some reason, options are separated by newline instead of space, so we
    # have to replace them first.
    - $env:CI_PROJECT_DIR = $env:CI_PROJECT_DIR.replace('\','/')
    - $env:MESON_ARGS = $env:MESON_ARGS.replace('\','/')

Jordan Petridіs's avatar
Jordan Petridіs committed
119
120
121
122
123
124
125
126
127
128
129
    # Build and run the tests.
    # This is part of the same job due to a bug in the gitlab-runner
    # that prevents us from exporting artifacts with docker-windows
    # executors. It has since been fixed in gitlab 12.1, but
    # we are blocked from upgrading currently.
    #
    # Gitlab Runner issue: https://gitlab.com/gitlab-org/gitlab-runner/issues/4291
    # Blocked upgrade issue: https://gitlab.freedesktop.org/gstreamer/gst-ci/issues/6#note_192780
    - C:\msys64\usr\bin\bash -c "meson build $env:MESON_ARGS &&
        ninja -C build &&
        meson test -C build --print-errorlogs --suite libnice"
130
131
132
133
134
  artifacts:
    when: on_failure
    paths:
      - build/meson-logs/
      - build/build.ninja
Jordan Petridіs's avatar
Jordan Petridіs committed
135

Olivier Crête's avatar
Olivier Crête committed
136
137
.build msvc:
  extends: build msys2
138
  allow_failure: false
139
140
  variables:
    GLIB_VERSION: 2.64.2
Olivier Crête's avatar
Olivier Crête committed
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
  script:
    # For some reason, options are separated by newline instead of space, so we
    # have to replace them first.
    - $env:MESON_ARGS = $env:MESON_ARGS.replace("`n"," ")

    # Build and run the tests.
    # This is part of the same job due to a bug in the gitlab-runner
    # that prevents us from exporting artifacts with docker-windows
    # executors. It has since been fixed in gitlab 12.1, but
    # we are blocked from upgrading currently.
    #
    # Gitlab Runner issue: https://gitlab.com/gitlab-org/gitlab-runner/issues/4291
    # Blocked upgrade issue: https://gitlab.freedesktop.org/gstreamer/gst-ci/issues/6#note_192780
    - New-Item -Path subprojects -Name openssl.wrap -Value "[wrap-git]`r`ndirectory=openssl`r`nurl=https://gitlab.freedesktop.org/libnice/openssl-binaries-for-ci.git`r`nrevision=1.1.1c`r`n"
    - cmd.exe /C "C:\BuildTools\Common7\Tools\VsDevCmd.bat -host_arch=amd64 -arch=$env:ARCH &&
        meson subprojects download &&
157
158
159
        meson wrap promote subprojects\glib-$env:GLIB_VERSION\subprojects\libffi.wrap &&
        meson wrap promote subprojects\glib-$env:GLIB_VERSION\subprojects\zlib.wrap &&
        meson wrap promote subprojects\glib-$env:GLIB_VERSION\subprojects\proxy-libintl.wrap &&
Olivier Crête's avatar
Olivier Crête committed
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
        meson subprojects download"
    - cmd.exe /C "C:\BuildTools\Common7\Tools\VsDevCmd.bat -host_arch=amd64 -arch=$env:ARCH &&
        meson build $env:MESON_ARGS &&
        ninja -C build &&
        meson test -C build --print-errorlogs --suite libnice"

build msvc amd64:
  extends: .build msvc
  variables:
    ARCH: 'amd64'

build msvc x86:
  extends: .build msvc
  variables:
    ARCH: 'x86'
        
176
177
test meson:
  stage: test
178
  image: registry.freedesktop.org/libnice/libnice/centos7/meson-build
179
  needs:
180
181
182
183
184
    - build meson
  except:
    - schedules
  script:
    - ifconfig
185
    - source scl_source enable rh-python36 && true
186
    - meson test -C build/ --setup debug
187
188
  artifacts:
    when: on_failure
189
190
    paths:
      - build/meson-logs/
Jordan Petridіs's avatar
Jordan Petridіs committed
191

192
193

test valgrind meson:
194
  extends: test meson
195
196
197
  script:
    - ifconfig
    - source scl_source enable rh-python36 && true
198
    - meson configure build -Dgtk_doc=disabled
199
200
201
    - meson test -C build/ --setup valgrind --print-errorlogs


202
203
doc-and-install meson:
  stage: test
204
  image: registry.freedesktop.org/libnice/libnice/centos7/meson-build
205
  needs:
206
207
208
209
210
211
    - build meson
  except:
    - schedules
  variables:
    PREFIX: "${CI_PROJECT_DIR}/libnice-prefix"
  script:
212
213
214
    - source scl_source enable rh-python36 && true
    - ninja-build -C build/ libnice-doc
    - ninja-build -C build/ install
215
216
217
218
219
    - ls -lR ${PREFIX}
  artifacts:
    paths:
      - build/docs/reference/libnice/html/

Olivier Crête's avatar
Olivier Crête committed
220
submit-to-coverity:
221
 stage: test
222
 image: registry.freedesktop.org/libnice/libnice/centos7/meson-build
223
224
 variables:
   COVERITY_PROJECT: libnice
225
   PREFIX: "${CI_PROJECT_DIR}/libnice-prefix"
Olivier Crête's avatar
Olivier Crête committed
226
227
 only:
  - schedules
228
  - web
229
 dependencies: []
230
231
 before_script:
  - mkdir -p "${CI_PROJECT_DIR}"
Olivier Crête's avatar
Olivier Crête committed
232
 script:
233
234
  - curl -v https://scan.coverity.com/download/linux64  -o coverity_tool.tgz  --form token="${COVERITY_TOKEN}" --form project="${COVERITY_PROJECT}" && tar xf coverity_tool.tgz && rm coverity_tool.tgz
  - mv cov-analysis-linux64-* cov-analysis-linux64
235
236
  - source scl_source enable rh-python36 && true
  - meson --werror --warnlevel 2 -Dgtk_doc=disabled -Dinstrospection=disabled --prefix=$PREFIX cov-build/
237
238
  - export PATH="$PATH:${CI_PROJECT_DIR}/cov-analysis-linux64/bin"
  - echo $PATH
239
  - cov-build --dir cov-int ninja-build -C cov-build
Olivier Crête's avatar
Olivier Crête committed
240
241
  - tar czvf libnice.tgz cov-int
  - curl --form token=$COVERITY_TOKEN --form email=olivier.crete@ocrete.ca --form file=@libnice.tgz --form version="${CI_COMMIT_REF_NAME}-${CI_COMMIT_SHA}" --form description="CI weekly run" https://scan.coverity.com/builds?project=libnice
Olivier Crête's avatar
Olivier Crête committed
242
243


244
documentation:
Olivier Crête's avatar
Olivier Crête committed
245
  stage: deploy
246
  dependencies:
Olivier Crête's avatar
Olivier Crête committed
247
248
    - doc-and-install meson
  only:
249
    - latest-release
Olivier Crête's avatar
Olivier Crête committed
250
251
252
  artifacts:
    paths:
      - public
253
    expire_in: 1 year
254
255
#  Needs gitlab 12.8, we're on 12.7 now
#  trigger: libnice/libnice-
Olivier Crête's avatar
Olivier Crête committed
256
  script:
257
258
    - mkdir public/
    - mv build/docs/reference/libnice/html/ public/libnice/