forked from virinext/pipeviz
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy path.gitlab-ci.yml
298 lines (279 loc) · 7.27 KB
/
.gitlab-ci.yml
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
293
294
295
296
297
298
include:
- project: "freedesktop/ci-templates" # the project to include from
ref: "34f4ade99434043f88e164933f570301fd18b125" # git ref of that project
file: "/templates/fedora.yml" # the actual file to include
- local: "ci/images_template.yml"
stages:
- prepare
- lint
- test
- release
- deploy
variables:
FDO_UPSTREAM_REPO: "dabrain34/GstPipelineStudio"
GNOME_RUNTIME_IMAGE: "quay.io/gnome_infrastructure/gnome-runtime-images:gnome-master"
WINDOWS_RUST_STABLE_IMAGE: "$CI_REGISTRY_IMAGE/windows:$GST_RS_WIN_IMG_TAG"
WINDOWS_RUST_STABLE_UPSTREAM_IMAGE: "$CI_REGISTRY/$FDO_UPSTREAM_REPO/windows:$GST_RS_WIN_IMG_TAG"
# Version and tag for our current container
.fedora:
variables:
FDO_DISTRIBUTION_VERSION: "38"
# Update this to trigger a container rebuild
FDO_DISTRIBUTION_TAG: $GST_RS_FDO_IMG_TAG
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 --color=always
# cargo update --color=always
# fi
build-fedora-container:
extends:
- .fedora # our template job above
- .fdo.container-build@fedora@x86_64 # the CI template
stage: prepare
variables:
# clang-devel: required by rust bindgen
FDO_DISTRIBUTION_PACKAGES: >-
gtk4-devel
clang-devel
gstreamer1-devel
gstreamer1-plugins-base-devel
gstreamer1-plugins-bad-free-devel
ninja-build
pkg-config
python3-devel
python3-pip
python3-setuptools
util-linux
xorg-x11-server-Xvfb
wget
git
flex
bison
FDO_DISTRIBUTION_EXEC: >-
ci/install-rust.sh stable &&
pip3 install meson &&
pip3 install pre-commit
.windows rust docker build:
stage: prepare
variables:
# Unlike the buildah/linux jobs, this file
# needs to be relative to windows-docker/ subdir
# as it makes life easier in the powershell script
#
# We also don't need a CONTEXT_DIR var as its also
# hardcoded to be windows-docker/
DOCKERFILE: "ci/windows-docker/Dockerfile"
GST_UPSTREAM_BRANCH: "1.22"
tags:
- "windows"
- "shell"
- "2022"
script:
# We need to pass an array and to resolve the env vars, so we can't use a variable:
- $DOCKER_BUILD_ARGS = @("--build-arg", "DEFAULT_GST_BRANCH=$GST_UPSTREAM_BRANCH", "--build-arg", "RUST_VERSION=$RUST_VERSION")
- "& ci/windows-docker/container.ps1 $CI_REGISTRY $CI_REGISTRY_USER $CI_REGISTRY_PASSWORD $RUST_IMAGE $RUST_UPSTREAM_IMAGE $DOCKERFILE"
- |
if (!($?)) {
echo "Failed to build the image"
Exit 1
}
windows rust docker stable:
extends: ".windows rust docker build"
variables:
RUST_IMAGE: $WINDOWS_RUST_STABLE_IMAGE
RUST_UPSTREAM_IMAGE: $WINDOWS_RUST_STABLE_UPSTREAM_IMAGE"]
RUST_VERSION: $GST_RS_STABLE
.msvc2019 build:
stage: test
tags:
- "docker"
- "windows"
- "2022"
windows installer stable:
needs:
- job: "windows rust docker stable"
artifacts: false
image: "$WINDOWS_RUST_STABLE_IMAGE"
extends: ".msvc2019 build"
script:
- rustc --version
- git fetch --tags
- "& ./ci/build_gps.ps1"
- "& ./installer/wix/prepare_gstreamer.ps1"
- "& ./installer/wix/build_installer.ps1"
artifacts:
paths:
- installer/wix/*.msi
expire_in: 10 days
when: "manual"
pre-commit:
stage: "lint"
extends:
- .fedora
- .fdo.distribution-image@fedora
variables:
PRE_COMMIT_HOME: ${CI_PROJECT_DIR}/.cache/pre-commit
cache:
paths:
- ${PRE_COMMIT_HOME}
script:
- meson setup build
- pre-commit run --all-files
clippy:
extends:
- .fedora
- .fdo.distribution-image@fedora
stage: lint
script:
- meson build
- cargo clippy --version
- cargo clippy --color=always --all-targets -- -D warnings
windows installer release:
extends: "windows installer stable"
stage: release
only:
- flatpak
- tags
artifacts:
paths:
- installer/wix/*.msi
when: "always"
linux release:
extends:
- .fedora
- .fdo.distribution-image@fedora
stage: release
only:
- flatpak
- tags
script:
- meson builddir -Dbuildtype=release
- ninja -C builddir/ dist
artifacts:
paths:
- builddir/meson-dist/*
when: "always"
test-stable:
extends:
- .fedora
- .fdo.distribution-image@fedora
stage: test
script:
- meson build
- rustc --version
- cargo build --color=always --all-targets
- >
xvfb-run -a -s "-screen 0 1024x768x24"
cargo test --color=always
rustdoc:
extends:
- .fedora
- .fdo.distribution-image@fedora
stage: release
only:
- flatpak
- tags
variables:
RUSTDOCFLAGS: "-Dwarnings"
script:
- meson build
- rustdoc --version
- cargo doc --no-deps
dist-package:
extends:
- .fedora
- .fdo.distribution-image@fedora
stage: release
only:
- flatpak
script:
- meson build
- ninja -C build dist
flatpak:
image: $GNOME_RUNTIME_IMAGE
stage: test
variables:
MANIFEST_PATH: "build-aux/org.freedesktop.dabrain34.GstPipelineStudio.Devel.json"
APP_ID: "org.freedesktop.dabrain34.GstPipelineStudio.Devel"
BUNDLE: "gst-pipeline-studio-nightly.flatpak"
script:
- flatpak-builder app ${MANIFEST_PATH}
- flatpak build-export repo app
- flatpak build-bundle repo ${BUNDLE} ${APP_ID}
artifacts:
name: "Flatpak artifacts"
expose_as: "Get Flatpak bundle here"
when: "always"
paths:
- "${BUNDLE}"
expire_in: 14 days
cache:
key: "flatpak"
paths:
- .flatpak-builder/downloads/
- .flatpak-builder/git/
- target/
- target_test/
when: "manual"
macos installer stable:
stage: test
tags:
- gst-macos-13
before_script:
- pip3 install --upgrade pip
# Make sure meson is up to date
- pip3 install -U meson
# Need to install certificates for python
- pip3 install --upgrade certifi
# Another way to install certificates
- open /Applications/Python\ 3.8/Install\ Certificates.command
# Get ninja
- pip3 install -U ninja
# Get tomlib
- pip3 install -U tomli
script:
# rust toolchain
- curl https://sh.rustup.rs -sSf | sh -s -- -y
- source $HOME/.cargo/env
# brew install
- /bin/bash -c "./installer/macos/package_setup.sh"
- /bin/bash -c "./installer/macos/deploy_macos.sh"
artifacts:
name: "MacOS installer"
paths:
- installer/**/GstPipelineStudio*.dmg
- installer/**/GstPipelineStudio*.tar.gz
expire_in: 14 days
when: "manual"
macos installer release:
extends: "macos installer stable"
stage: release
only:
- flatpak
- tags
artifacts:
name: "MacOS installer"
paths:
- installer/**/GstPipelineStudio*.dmg
- installer/**/GstPipelineStudio*.tar.gz
when: "always"
pages:
image: ruby:2.7
stage: deploy
script:
- gem install bundler -v 2.4.22
- bundle install
- bundle exec jekyll build -d public
artifacts:
paths:
# The folder that contains the files to be exposed at the Page URL
- public
rules:
# This ensures that only pushes to the default branch will trigger
# a pages deploy
- if: $CI_COMMIT_REF_NAME == $CI_DEFAULT_BRANCH