.gitlab-ci.yml 2.44 KB
Newer Older
1
stages:
2
  - "lint"
3
  - "test"
Jordan Petridis's avatar
Jordan Petridis committed
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 12
    DEPENDENCIES: |
      curl
13 14
      libssl-dev
      liborc-0.4-dev
15 16 17 18 19 20 21 22 23 24 25
      libglib2.0-dev
      libxml2-dev
      libgtk-3-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
26

27 28
    - mkdir -p precompiled-gst && cd precompiled-gst

29
    - curl -L https://people.freedesktop.org/~slomo/gstreamer-1.16.0.tar.gz | tar xz
30 31 32 33 34 35
    - 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
36 37 38 39 40 41 42

    - cd "${CI_PROJECT_DIR}"
  cache:
    key: "gst"
    paths:
      - "${CARGO_HOME}"

43 44
.cargo test:
  extends: '.tarball_setup'
45
  stage: "test"
46 47
  script:
    - rustc --version
48 49
    - cargo build --color=always --all
    - G_DEBUG=fatal_warnings cargo test --color=always --all
50 51 52 53 54 55

    - |
      if [ -n "$NIGHTLY" ]; then
        cargo build --color=always --all --all-features
        G_DEBUG=fatal_warnings cargo test --color=always --all --all-features
      fi
56

57 58
test 1.34:
  # 1.34 img
59
  # https://hub.docker.com/_/rust/
60
  image: "rust:1.34-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 75
  variables:
    NIGHTLY: 'yes'
76
  extends: '.cargo test'
77 78

rustfmt:
79
  image: "rust:slim"
80 81
  stage: "lint"
  script:
82
    - rustup component add rustfmt
83 84
    - cargo fmt --version
    - cargo fmt -- --color=always --check
Jordan Petridis's avatar
Jordan Petridis committed
85 86

clippy:
87
  extends: '.tarball_setup'
88
  image: "rustlang/rust:nightly-slim"
Jordan Petridis's avatar
Jordan Petridis committed
89
  stage: 'extras'
90
  allow_failure: true
Jordan Petridis's avatar
Jordan Petridis committed
91 92 93 94
  script:
    - rustup component add clippy-preview
    - cargo clippy --version
    - cargo clippy --color=always --all --all-features