.gitlab-ci.yml 6.59 KB
Newer Older
Tim-Philipp Müller's avatar
Tim-Philipp Müller committed
1 2 3
stages:
 - build

4 5 6
variables:
  MESON_ARGS: --werror --fatal-meson-warnings

Tim-Philipp Müller's avatar
Tim-Philipp Müller committed
7 8 9 10 11 12 13 14 15 16 17 18
debian sid:
  image: 'debian:sid'
  stage: build
  variables:
    DEPENDENCIES: >
      meson
      ninja-build
      build-essential
  before_script:
    - apt-get update
    - apt-get install --yes ${DEPENDENCIES}
  script:
19
    - meson setup $MESON_ARGS build/
20
    - meson compile --verbose -C build/
21 22
    - meson test -C build/
    - meson test -C build/ --benchmark
23
    - meson install -C build/
Tim-Philipp Müller's avatar
Tim-Philipp Müller committed
24 25 26
  artifacts:
    paths:
      - build/meson-logs/
27 28

.build windows:
29
  image: 'registry.freedesktop.org/gstreamer/gst-ci/amd64/windows:v11-master'
30 31 32 33
  stage: 'build'
  tags:
    - 'docker'
    - 'windows'
34
    - '1809'
35
    - 'gstreamer-windows'
36 37 38 39 40 41 42 43 44 45 46
  variables:
    # Make sure any failure in PowerShell scripts is fatal
    ErrorActionPreference: 'Stop'
    WarningPreference: 'Stop'
    # Uncomment the following key if need to pass custom args, as well with the
    # $env:MESON_ARGS line in the `script:` blocks
    # MESON_ARGS: >-
    #   -Dfoo=enabled
    #   -Dbar=disabled
  before_script:
    # Make sure meson is up to date, so we don't need to rebuild the image with each release
47
    - pip3 install -U meson ninja
48 49 50
  script:
    # For some reason, options are separated by newline instead of space, so we
    # have to replace them first.
51
    #- $env:MESON_ARGS = $env:MESON_ARGS.replace("`n"," ")
52 53 54 55
    # Gitlab executes PowerShell in docker, but VsDevCmd.bat is a batch script.
    # Environment variables substitutions is done by PowerShell before calling
    # cmd.exe, that's why we use $env:FOO instead of %FOO%
    - cmd.exe /C "C:\BuildTools\Common7\Tools\VsDevCmd.bat -host_arch=amd64 -arch=$env:ARCH &&
56
        meson setup build $env:MESON_ARGS &&
57
        meson compile --verbose -C build &&
58 59
        meson test -C build &&
        meson test -C build --benchmark"
60 61 62 63 64 65 66 67 68 69 70 71 72

vs2017 amd64:
  extends: '.build windows'
  variables:
    ARCH: 'amd64'

vs2017 x86:
  extends: '.build windows'
  variables:
    ARCH: 'x86'

msys2:
  extends: '.build windows'
73 74
  when: 'manual'
  allow_failure: true
75
  script:
76
    # XXX: Copied from https://gitlab.freedesktop.org/gstreamer/gst-ci/blob/master/gitlab/ci_template.yml#L487
77
    - $env:PATH += ";C:\msys64\usr\bin;C:\msys64\mingw64\bin;C:\msys64\mingw32\bin"
78
    - C:\msys64\usr\bin\bash -c "pacman-key --init && pacman-key --populate msys2 && pacman-key --refresh-keys || true"
79 80 81 82 83 84 85 86
    - C:\msys64\usr\bin\bash -c "sed -i 's/^CheckSpace/#CheckSpace/g' /etc/pacman.conf"
    - echo "Updating MSYS2"
    - C:\msys64\usr\bin\bash -c "pacman -Syuu --noconfirm || echo Update failed, ignoring"
    - echo "Killing all MSYS2 processes"
    - taskkill /F /FI "MODULES eq msys-2.0.dll"
    - echo "Completing MSYS2 update"
    - C:\msys64\usr\bin\bash -c "pacman -Suu --noconfirm"
    - echo "Installing needed MSYS2 packages"
87
    - C:\msys64\usr\bin\bash -c "pacman -Sy --noconfirm --needed mingw-w64-x86_64-toolchain ninja"
88
    - C:\msys64\usr\bin\bash -c "meson setup build $env:MESON_ARGS &&
89
        meson compile --verbose -C build &&
90 91
        meson test -C build &&
        meson test -C build --benchmark"
Tim-Philipp Müller's avatar
Tim-Philipp Müller committed
92

93
macos x86_64:
Tim-Philipp Müller's avatar
Tim-Philipp Müller committed
94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113
  stage: 'build'
  tags:
    - gst-macos-10.15
  artifacts:
    name: "${CI_JOB_NAME}_${CI_COMMIT_SHA}"
    expire_in: '5 days'
    when: 'always'
    paths:
      - "build/meson-logs/*txt"
  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
    # Anther way to install certificates
    - open /Applications/Python\ 3.8/Install\ Certificates.command
    # Get ninja
    - pip3 install -U ninja
  script:
114 115 116
    - CERT_PATH=$(python3 -m certifi) && export SSL_CERT_FILE=${CERT_PATH} && export REQUESTS_CA_BUNDLE=${CERT_PATH}
    - meson setup --werror build
    - meson compile --verbose -C build
Tim-Philipp Müller's avatar
Tim-Philipp Müller committed
117 118
    - meson test -C build
    - meson test -C build --benchmark
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

ios arm64:
  stage: 'build'
  tags:
    - gst-ios-13.2
  artifacts:
    name: "${CI_JOB_NAME}_${CI_COMMIT_SHA}"
    expire_in: '5 days'
    when: 'always'
    paths:
      - "build/meson-logs/*txt"
  before_script:
    - pip3 install --upgrade pip
    # Make sure meson and meson are up to date
    - pip3 install -U meson ninja
    # Need to install certificates for python
    - pip3 install --upgrade certifi
    # Anther way to install certificates
    - open /Applications/Python\ 3.8/Install\ Certificates.command
  script:
    - CERT_PATH=$(python3 -m certifi) && export SSL_CERT_FILE=${CERT_PATH} && export REQUESTS_CA_BUNDLE=${CERT_PATH}
    - |
      cat > ios-cross-file.txt <<EOF
      [host_machine]
      system = 'darwin'
      cpu_family = 'aarch64'
      cpu = 'aarch64'
      endian = 'little'

      [properties]
      c_args      = ['-arch', 'arm64', '--sysroot=$(xcrun --sdk iphoneos --show-sdk-path)', '-miphoneos-version-min=8.0']
      c_link_args = ['-arch', 'arm64', '--sysroot=$(xcrun --sdk iphoneos --show-sdk-path)', '-miphoneos-version-min=8.0']

      [binaries]
      ar        = '$(xcrun --find --sdk iphoneos ar)'
      c         = '$(xcrun --find --sdk iphoneos clang)'
      cpp       = '$(xcrun --find --sdk iphoneos clang++)'
      ranlib    = '$(xcrun --find --sdk iphoneos ranlib)'
      strip     = '$(xcrun --find --sdk iphoneos strip)'
      pkgconfig = 'false'
      EOF
    - meson setup --werror -Dorc-test=disabled -Db_bitcode=true --cross-file ios-cross-file.txt build
    - meson compile --verbose -C build
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

android fedora arm64:
  image: 'registry.freedesktop.org/gstreamer/gst-ci/amd64/android-fedora:2020-06-25.0-master'
  stage: 'build'
  artifacts:
    name: "${CI_JOB_NAME}_${CI_COMMIT_SHA}"
    expire_in: '5 days'
    when: 'always'
    paths:
      - "build/meson-logs/*.txt"
  before_script:
    - dnf install -y python3-pip gcc ninja-build
    - pip3 install --user meson
  script:
    - export PATH="$HOME/.local/bin:$PATH"
    - |
      cat > android-cross-file.txt <<EOF
      [constants]
      ndk_path    = '/android/ndk'
      toolchain   = ndk_path + '/toolchains/llvm/prebuilt/linux-x86_64/bin/aarch64-linux-android'
      api         = '28'

      [host_machine]
      system      = 'android'
      cpu_family  = 'aarch64'
      cpu         = 'aarch64'
      endian      = 'little'

      [properties]
      sys_root        = ndk_path + '/sysroot'
      c_link_args     = ['-fuse-ld=gold']
      cpp_link_args   = ['-fuse-ld=gold']

      [binaries]
      c           = toolchain + api + '-clang'
      cpp         = toolchain + api + '-clang++'
      ar          = toolchain + '-ar'
      strip       = toolchain + '-strip'
      EOF
    - meson setup --werror --cross-file android-cross-file.txt build
    - meson compile --verbose -C build