.gitlab-ci.yml 2.42 KB
Newer Older
1 2
stages:
  - "lint"
3
  - "test"
4
  - "extras"
5

6
.tarball_setup:
7
  variables:
8 9 10
    # Only stuff inside the repo directory can be cached
    # Override the CARGO_HOME variable to force its location
    CARGO_HOME: "${CI_PROJECT_DIR}/.cargo_home"
11
    SODIUM_USE_PKG_CONFIG: "true"
12 13
    DEPENDENCIES: |
      curl
14 15
      file
      libsodium-dev
16 17 18
      libssl-dev
      liborc-0.4-dev
      libglib2.0-dev
19 20
      libgdk-pixbuf2.0-dev
      libgtk-3-dev
21 22 23 24 25 26 27 28 29 30 31 32
      libxml2-dev
      libegl1-mesa
      libgles2-mesa
      libgl1-mesa-dri
      libgl1-mesa-glx
      libwayland-egl1-mesa
  before_script:
    - apt-get update -yqq
    - apt-get install -yqq --no-install-recommends $DEPENDENCIES

    - mkdir -p precompiled-gst && cd precompiled-gst

Sebastian Dröge's avatar
Sebastian Dröge committed
33
    - curl -L https://people.freedesktop.org/~slomo/gstreamer-1.16.0.tar.gz | tar xz
34 35 36 37 38 39 40
    - sed -i "s;prefix=/root/gstreamer;prefix=$PWD/gstreamer;g" $PWD/gstreamer/lib/x86_64-linux-gnu/pkgconfig/*.pc
    - export PKG_CONFIG_PATH=$PWD/gstreamer/lib/x86_64-linux-gnu/pkgconfig
    - export GST_PLUGIN_SYSTEM_PATH=$PWD/gstreamer/lib/x86_64-linux-gnu/gstreamer-1.0
    - export GST_PLUGIN_SCANNER=$PWD/gstreamer/libexec/gstreamer-1.0/gst-plugin-scanner
    - export PATH=$PATH:$PWD/gstreamer/bin
    - export LD_LIBRARY_PATH=$PWD/gstreamer/lib/x86_64-linux-gnu:$LD_LIBRARY_PATH

41 42 43 44 45 46 47 48 49
    - cd "${CI_PROJECT_DIR}"
  cache:
    key: "gst"
    paths:
      - "${CARGO_HOME}"

.cargo test:
  extends: '.tarball_setup'
  stage: "test"
50
  script:
51 52 53 54 55
    - rustc --version
    - cargo build --color=always --all
    - G_DEBUG=fatal_warnings cargo test --color=always --all
    - cargo build --color=always --all --examples --all-features
    - G_DEBUG=fatal_warnings cargo test --color=always --all --examples --all-features
56

57 58
test 1.36:
  # 1.36 img
59
  # https://hub.docker.com/_/rust/
60
  image: "rust:1.36-slim"
61
  extends: '.cargo test'
62 63 64 65 66

test stable:
  # Stable img
  # https://hub.docker.com/_/rust/
  image: "rust:slim"
67
  extends: '.cargo test'
68 69 70 71 72 73

test nightly:
  # Nightly
  # https://hub.docker.com/r/rustlang/rust/
  image: "rustlang/rust:nightly-slim"
  allow_failure: true
74
  extends: '.cargo test'
75 76

rustfmt:
François Laignel's avatar
François Laignel committed
77
  image: "rust:slim"
78 79
  stage: "lint"
  script:
François Laignel's avatar
François Laignel committed
80
    - rustup component add rustfmt
81 82
    - cargo fmt --version
    - cargo fmt -- --color=always --check
83 84 85 86 87 88 89 90 91

clippy:
  extends: '.tarball_setup'
  image: "rust:slim"
  stage: 'extras'
  allow_failure: true
  script:
    - rustup component add clippy-preview
    - cargo clippy --color=always --all --all-features