Welcome to mirror list, hosted at ThFree Co, Russian Federation.

.gitlab-ci.yml - gitlab.freedesktop.org/gstreamer/gst-plugins-rs.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: d72827b0747cf193fe95aad557ec3b69d9a88f9c (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
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
.templates_sha: &templates_sha 567700e483aabed992d0a4fea84994a0472deff6

include:
  - project: 'freedesktop/ci-templates'
    ref: *templates_sha
    file: '/templates/debian.yml'

  - remote: "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/-/raw/main/ci/images_template.yml"

variables:
  FDO_UPSTREAM_REPO: gstreamer/gst-plugins-rs

workflow:
  rules:
    - if: $CI_MERGE_REQUEST_IID
    # don't create a pipeline if its a commit pipeline, on a branch and that branch has
    # open merge requests (bc we will get a MR build instead)
    - if: $CI_OPEN_MERGE_REQUESTS
      when: never
    - if: $CI_COMMIT_TAG
    - if: $CI_COMMIT_BRANCH

stages:
  - "prep"
  - "lint"
  - "test"
  - "extras"

.debian:11:
  variables:
    FDO_DISTRIBUTION_VERSION: 'bullseye-slim'
  before_script:
    - source ./ci/env.sh
    - mkdir .cargo && echo -e "[net]\ngit-fetch-with-cli = true" > .cargo/config
    # If cargo exists assume we probably will want to update
    # the lockfile
    - |
      if command -v cargo; then
        cargo generate-lockfile
        cargo update
      fi

.debian:11-stable:
  extends: .debian:11
  variables:
    FDO_DISTRIBUTION_TAG: '$GST_RS_STABLE-${GST_RS_IMG_TAG}_2022-07-19.0'
    FDO_BASE_IMAGE: "registry.freedesktop.org/gstreamer/gstreamer-rs/debian/bullseye-slim:$GST_RS_STABLE-$GST_RS_IMG_TAG"

.debian:11-msrv:
  extends: .debian:11
  variables:
    FDO_DISTRIBUTION_TAG: '$GST_RS_MSRV-${GST_RS_IMG_TAG}_2022-07-19.0'
    FDO_BASE_IMAGE: "registry.freedesktop.org/gstreamer/gstreamer-rs/debian/bullseye-slim:$GST_RS_MSRV-$GST_RS_IMG_TAG"

.debian:11-nightly:
  extends: .debian:11
  variables:
    FDO_DISTRIBUTION_TAG: 'nightly-${GST_RS_IMG_TAG}_2022-07-19.0'
    FDO_BASE_IMAGE: "registry.freedesktop.org/gstreamer/gstreamer-rs/debian/bullseye-slim:nightly-$GST_RS_IMG_TAG"

.build-debian-container:
  extends:
  - .fdo.container-build@debian
  stage: prep
  variables:
    FDO_DISTRIBUTION_PACKAGES: "libcsound64-dev llvm clang nasm libsodium-dev"
    FDO_DISTRIBUTION_EXEC: >-
      bash ci/install-dav1d.sh &&
      apt clean &&
      bash ./ci/install-rust-ext.sh
  rules:
    - if: '$UPDATE_IMG == null'

build-stable:
  extends:
    - .build-debian-container
    - .debian:11-stable

build-msrv:
  extends:
    - .build-debian-container
    - .debian:11-msrv

build-nightly:
  extends:
    - .build-debian-container
    - .debian:11-nightly

# Those jobs are triggered by gstreamer-rs when updating its images
update-stable:
  extends: build-stable
  rules:
    - if: '$UPDATE_IMG == "stable"'
  variables:
      FDO_FORCE_REBUILD: 1

update-msrv:
  extends: build-msrv
  rules:
    - if: '$UPDATE_IMG == "msrv"'
  variables:
      FDO_FORCE_REBUILD: 1

update-nightly:
  extends: build-nightly
  rules:
    - if: '$UPDATE_IMG == "nightly"'
  variables:
      FDO_FORCE_REBUILD: 1

.dist-debian-container:
  extends:
  - .fdo.distribution-image@debian
  variables:
    SODIUM_USE_PKG_CONFIG: "true"
  after_script:
    - rm -rf target

.img-stable:
  extends:
    - .dist-debian-container
    - .debian:11-stable

.img-msrv:
  extends:
    - .dist-debian-container
    - .debian:11-msrv

.img-nightly:
  extends:
    - .dist-debian-container
    - .debian:11-nightly

.cargo test:
  stage: "test"
  variables:
    # csound-sys only looks at /usr/lib and /usr/local top levels
    CSOUND_LIB_DIR: '/usr/lib/x86_64-linux-gnu/'
    RUST_BACKTRACE: 'full'
  script:
    - rustc --version

    - cargo build --locked --color=always --workspace --all-targets
    - G_DEBUG=fatal_warnings cargo test --locked --color=always --workspace --all-targets
    - cargo build --locked --color=always --workspace --all-targets --all-features
    - G_DEBUG=fatal_warnings cargo test --locked --color=always --workspace --all-targets --all-features

test msrv:
  extends:
    - '.cargo test'
    - .img-msrv
  rules:
    - if: '$UPDATE_IMG == null || $UPDATE_IMG == "msrv"'

test stable:
  extends:
    - '.cargo test'
    - .img-stable
  rules:
    - if: '$UPDATE_IMG == null || $UPDATE_IMG == "stable"'

test nightly:
  allow_failure: true
  extends:
    - '.cargo test'
    - .img-nightly
  rules:
    - if: '$UPDATE_IMG == null || $UPDATE_IMG == "nightly"'

.meson:
  extends: .img-stable
  rules:
    - if: '$UPDATE_IMG == null || $UPDATE_IMG == "stable"'
  variables:
    # csound-sys only looks at /usr/lib and /usr/local top levels
    CSOUND_LIB_DIR: '/usr/lib/x86_64-linux-gnu/'

meson shared:
  extends: .meson
  variables:
    CI_ARTIFACTS_URL: "${CI_PROJECT_URL}/-/jobs/${CI_JOB_ID}/artifacts/raw/"
  script:
    - meson build --default-library=shared --prefix=$(pwd)/install
    - ninja -C build install
    - ./ci/check-plugins-installed.py install
    - ninja -C build docs/gst_plugins_cache.json
    - ci/check-documentation-diff.py
  artifacts:
    when: always
    expire_in: "7 days"
    paths:
    - plugins-cache-diffs/

meson static:
  extends: .meson
  script:
    - meson build --default-library=static --prefix=$(pwd)/install -Dsodium=built-in
    - ninja -C build install
    - ./ci/generate-static-test.py test-static-link-all
    - cd test-static-link-all
    - PKG_CONFIG_PATH=$PKG_CONFIG_PATH:$(pwd)/../install/lib/x86_64-linux-gnu/pkgconfig meson build
    - ninja -C build
    - ./build/test-gst-static

# build gst-plugins-rs as a gst-build subproject
gst-build:
  extends: .meson
  rules:
    - if: '$CI_PIPELINE_SOURCE == "schedule"'
  script:
    - P=$(pwd)
    - cd ..
    - rm -rf gstreamer
    - git clone --depth 1 https://gitlab.freedesktop.org/gstreamer/gstreamer.git --branch main
    - cd gstreamer
    - ln -s $P subprojects/gst-plugins-rs
    - meson build -Domx=disabled -Dpython=disabled -Dlibav=disabled -Dlibnice=disabled -Dugly=disabled -Dbad=disabled -Ddevtools=disabled -Dges=disabled -Drtsp_server=disabled -Dvaapi=disabled -Dsharp=disabled -Dgst-examples=disabled -Drs=enabled -Dgst-plugins-rs:sodium=system
    - ninja -C build

rustfmt:
  extends: .img-stable
  stage: "lint"
  rules:
    - when: 'always'
  script:
    - cargo fmt --version
    - cargo fmt -- --color=always --check

check commits:
  extends: .img-stable
  stage: "lint"
  rules:
    - when: 'always'
  script:
    - ci-fairy check-commits --textwidth 0 --no-signed-off-by

clippy:
  extends: .img-stable
  stage: 'extras'
  variables:
    # csound-sys only looks at /usr/lib and /usr/local top levels
    CSOUND_LIB_DIR: '/usr/lib/x86_64-linux-gnu/'
  rules:
    - when: 'always'
  script:
    - cargo clippy --locked --color=always --all --all-features --all-targets -- -D warnings

deny:
  extends: .img-stable
  stage: 'extras'
  rules:
    - if: '$CI_PIPELINE_SOURCE == "schedule"'
  script:
    - cargo deny check

outdated:
  extends: .img-stable
  allow_failure: true
  stage: 'extras'
  rules:
    - if: '$CI_PIPELINE_SOURCE == "schedule"'
  script:
    - cargo outdated --root-deps-only --exit-code 1 -v

coverage:
  allow_failure: true
  extends:
    - .img-stable
  stage: 'extras'
  rules:
    - when: 'always'
  variables:
    RUSTFLAGS: "-Cinstrument-coverage"
    LLVM_PROFILE_FILE: "gst-plugins-rs-%p-%m.profraw"
    # csound-sys only looks at /usr/lib and /usr/local top levels
    CSOUND_LIB_DIR: '/usr/lib/x86_64-linux-gnu/'
  script:
    - cargo test --locked --color=always --all --all-features
    # generate html report
    - grcov . --binary-path ./target/debug/ -s . -t html --branch --ignore-not-existing --ignore "*target*" --ignore "*/build.rs" -o ./coverage/
    # generate cobertura report for gitlab integration
    - grcov . --binary-path ./target/debug/ -s . -t cobertura --branch --ignore-not-existing --ignore "*target*" --ignore "*/build.rs" -o coverage.xml
    # output coverage summary for gitlab parsing.
    # TODO: use grcov once https://github.com/mozilla/grcov/issues/556 is fixed
    - grep "%" coverage/index.html | head -1 || true
  artifacts:
    paths:
      - 'coverage'
    reports:
      coverage_report:
        coverage_format: cobertura
        path: coverage.xml