+ needs:
+ - "trigger"
+ timeout: '3h'
+ variables:
+ # Unlike the buildah/linux jobs, this file
+ # needs to be relative to docker/windows/ 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 docker/windows/
+ DOCKERFILE: "ci/docker/windows/Dockerfile"
+ 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_BRANCH=$GST_UPSTREAM_BRANCH")
+
+ - "& ci/docker/windows/container.ps1 $CI_REGISTRY $CI_REGISTRY_USER $CI_REGISTRY_PASSWORD $WINDOWS_IMAGE $WINDOWS_UPSTREAM_IMAGE $DOCKERFILE"
+ - |
+ if (!($?)) {
+ echo "Failed to build the image"
+ Exit 1
+ }
+
+
+# ---- Preparation ----- #
+#
+# gst-indent!!
+#
+gst indent:
+ extends:
+ - '.gst-indent image'
+ - '.fdo.suffixed-image@debian'
+ stage: 'preparation'
+ needs:
+ - job: 'gst-indent amd64 docker'
+ artifacts: false
+ script:
+ - ./scripts/check-format-c
+ - ./scripts/format-csharp --check
+ rules:
+ # Don't check indentation on post merge pipelines
+ - if: '$CI_PROJECT_NAMESPACE == "gstreamer" && $CI_COMMIT_BRANCH == $GST_UPSTREAM_BRANCH'
+ when: 'manual'
+ - if: '$CI_PROJECT_NAMESPACE != "gstreamer" || $CI_COMMIT_BRANCH != $GST_UPSTREAM_BRANCH'
+ when: 'always'
+
+#
+# build setup templates
+#
+.build_template: &build
+ - date -R
+ - ci/scripts/handle-subprojects-cache.py subprojects/
+ - date -R
+ - echo $MESON_ARGS
+ - date -R
+ - meson build/ $MESON_ARGS
+ - date -R
+ - ninja -C build/
+ - date -R
+ - ccache --show-stats
+
+.build_ccache_vars:
+ variables:
+ CCACHE_COMPILERCHECK: 'content'
+ CCACHE_COMPRESS: 'true'
+ CCACHE_BASEDIR: '/cache/gstreamer/gstreamer'
+ CCACHE_DIR: '/cache/gstreamer/gstreamer/ccache/'
+ # shared across everything really
+ CCACHE_MAXSIZE: '10G'
+ CARGO_HOME: '/cache/gstreamer/cargo'
+
+.base_modules_changes: &modules_changes
+ - .gitlab-ci.yml
+ - gst-env.py
+ - ci/gitlab/*.py
+ - meson.build
+ - subprojects/*.wrap
+ - subprojects/gst-devtools/**/*
+ - subprojects/gst-editing-services/**/*
+ - subprojects/gst-integration-testsuites/**/*
+ - subprojects/gst-libav/**/*
+ - subprojects/gst-omx/**/*
+ - subprojects/gst-plugins-bad/**/*
+ - subprojects/gst-plugins-base/**/*
+ - subprojects/gst-plugins-good/**/*
+ - subprojects/gst-plugins-ugly/**/*
+ - subprojects/gst-python/**/*
+ - subprojects/gstreamer/**/*
+ - subprojects/gstreamer-sharp/**/*
+ - subprojects/gstreamer-vaapi/**/*
+ - subprojects/gst-rtsp-server/**/*
+
+.simple_fedora_build: &simple_build >-
+ ${DEFAULT_MESON_ARGS}
+ -Dsharp=enabled
+ -Domx=enabled
+ -Dgst-omx:target=generic
+ -Ddoc=disabled
+ -Drs=disabled
+ ${MESON_BUILDTYPE_ARGS}
+ ${MESON_GST_WERROR}
+
+.build:
+ stage: 'build'
+ extends:
+ - '.build_ccache_vars'
+ needs:
+ - "trigger"
+ # Taking into account the slowest shared runner + time needed to upload the binaries to artifacts
+ # Also need to take into account I/O of pulling docker images and uploading artifacts
+ timeout: '45min'
+ variables:
+ MESON_ARGS: "${DEFAULT_MESON_ARGS} ${MESON_BUILDTYPE_ARGS} ${MESON_GST_WERROR}"
+ script:
+ - *build
+ - ./gst-env.py gst-inspect-1.0 --version
+ - ./gst-env.py gst-inspect-1.0
+ after_script:
+ - mv build/meson-logs/ meson-logs
+ artifacts:
+ expire_in: "7 days"
+ when: "always"
+ paths:
+ - 'meson-logs/'
+ rules:
+ # If this matches, it means the pipeline is running against either the main
+ # or a stable branch, so make it manual
+ - if: '$CI_PROJECT_NAMESPACE == "gstreamer" && $CI_COMMIT_BRANCH == $GST_UPSTREAM_BRANCH'
+ when: manual
+ - changes:
+ *modules_changes
+
+.build fedora x86_64:
+ extends:
+ - '.fedora image'
+ - '.fdo.suffixed-image@fedora'
+ - '.build'
+ needs:
+ - "trigger"
+ - "fedora amd64 docker"
+ variables:
+ MESON_ARGS: *simple_build
+
+build fedora x86_64:
+ extends:
+ - '.fedora image'
+ - '.fdo.suffixed-image@fedora'
+ - '.build fedora x86_64'
+ needs:
+ - "trigger"
+ - "fedora amd64 docker"
+ script:
+ - *build
+ - ./gst-env.py gst-inspect-1.0 --version
+ - ./gst-env.py gst-inspect-1.0
+ - meson install --destdir $CI_PROJECT_DIR/destdir -C build
+ - rm -rf $CI_PROJECT_DIR/destdir
+
+build nodebug fedora x86_64:
+ extends:
+ - '.fedora image'
+ - '.fdo.suffixed-image@fedora'
+ - '.build'
+ needs:
+ - "trigger"
+ - "fedora amd64 docker"
+ variables:
+ MESON_ARGS: "${DEFAULT_MESON_ARGS} -Dsharp=enabled -Dgstreamer:gst_debug=false -Domx=enabled -Dgst-omx:target=generic ${MESON_BUILDTYPE_ARGS} ${MESON_GST_WERROR}"
+
+build clang fedora x86_64:
+ extends: '.build fedora x86_64'
+ variables:
+ CC: 'ccache clang'
+ CXX: 'ccache clang++'
+
+.build windows:
+ image: $WINDOWS_IMAGE
+ stage: 'build'
+ tags:
+ - 'docker'
+ - 'windows'
+ - '2022'
+ needs:
+ - "trigger"
+ - "windows amd64 docker"
+ timeout: '45min'
+ variables:
+ MESON_ARGS: >
+ ${DEFAULT_MESON_ARGS}
+ -Dpython=disabled
+ -Dlibav=disabled
+ -Dvaapi=disabled
+ -Dgst-plugins-base:pango=enabled
+ -Dgst-plugins-good:cairo=enabled
+ # Needs to not be empty otherwise the newline -> space replace command in
+ # `script:` will fail
+ MESON_CROSS_ARGS: ' '
+ rules:
+ # If this matches, it means the pipeline is running against either the main
+ # or a stable branch, so make it manual
+ - if: '$CI_PROJECT_NAMESPACE == "gstreamer" && $CI_COMMIT_BRANCH == $GST_UPSTREAM_BRANCH'
+ when: manual
+ - changes:
+ *modules_changes
+ - changes:
+ - subprojects/win-*/*
+ script:
+ # Make sure powershell exits on errors
+ # https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_preference_variables?view=powershell-6
+ - $ErrorActionPreference = "Stop"
+
+ # Set the code page to UTF-8
+ - chcp 65001
+
+ - ci/scripts/handle-subprojects-cache.py subprojects/
+ # 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:MESON_CROSS_ARGS = $env:MESON_CROSS_ARGS.replace("`n"," ")
+ - cmd.exe /C "C:\BuildTools\Common7\Tools\VsDevCmd.bat -host_arch=amd64 -arch=$env:ARCH &&
+ meson build $env:MESON_ARGS $env:MESON_CROSS_ARGS &&
+ meson compile -C build"
+ artifacts:
+ expire_in: "7 days"
+ when: "always"
+ paths:
+ - 'build/meson-logs/'
+
+build vs2019 amd64:
+ extends: '.build windows'
+ variables:
+ ARCH: 'amd64'
+ script:
+ - !reference [".build windows", "script",]
+ - cmd.exe /C "C:\BuildTools\Common7\Tools\VsDevCmd.bat -host_arch=amd64 -arch=$env:ARCH &&
+ .\gst-env.py gst-inspect-1.0.exe --version &&
+ .\gst-env.py gst-inspect-1.0.exe &&
+ mkdir .\destdir &&
+ meson install --destdir=$env:CI_PROJECT_DIR\destdir -C build &&
+ rmdir /s /q $env:CI_PROJECT_DIR\destdir"
+
+build vs2019 x86:
+ extends: '.build windows'
+ variables:
+ ARCH: 'x86'
+
+build vs2019 arm64 uwp:
+ extends: '.build windows'
+ variables:
+ ARCH: 'arm64'
+ # pango pulls in cairo which pulls in pixman which doesn't build because of
+ # https://github.com/mesonbuild/meson/issues/9889
+ MESON_CROSS_ARGS: >
+ -Dgst-plugins-base:pango=disabled
+ -Dgst-plugins-good:cairo=disabled
+ -Dgst-devtools:cairo=disabled
+ --cross-file ci/meson/vs2019-arm64-cross-file.txt
+ --native-file ci/meson/vs2019-x64-native-file.txt
+
+build msys2 :
+ extends: '.build windows'
+ timeout: '60min'
+ rules:
+ - changes:
+ *modules_changes
+ allow_failure: true
+ when: 'manual'