.gitlab-ci.yml 2.38 KB
Newer Older
1 2 3
include:
  - remote: "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/-/raw/master/ci/images_template.yml"

Jordan Petridіs's avatar
Jordan Petridіs committed
4
stages:
5
  - "lint"
Jordan Petridіs's avatar
Jordan Petridіs committed
6 7
  - "test"

8 9 10 11 12 13 14 15 16 17
.base:
  image: "registry.freedesktop.org/gstreamer/gstreamer-rs/debian/10:$RUST_VERSION-$GST_RS_IMG_TAG"
  variables:
    # 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"
    G_DEBUG: "fatal_warnings"
  before_script:
    - source ./ci/env.sh
    - mkdir .cargo && echo -e "[net]\ngit-fetch-with-cli = true" > .cargo/config
Jordan Petridіs's avatar
Jordan Petridіs committed
18 19 20
  cache:
    key: "gst"
    paths:
21
      - "${CARGO_HOME}"
Jordan Petridіs's avatar
Jordan Petridіs committed
22

23 24
.img-stable:
  extends: .base
Jordan Petridіs's avatar
Jordan Petridіs committed
25
  variables:
26
    RUST_VERSION: "stable"
Jordan Petridіs's avatar
Jordan Petridіs committed
27

28 29 30 31
.img-1-40:
  extends: .base
  variables:
    RUST_VERSION: "1.40.0"
Jordan Petridіs's avatar
Jordan Petridіs committed
32

33 34 35 36
.img-nightly:
  extends: .base
  variables:
    RUST_VERSION: "nightly"
37

38 39 40
.cargo test:
  stage: "test"
  script:
Jordan Petridіs's avatar
Jordan Petridіs committed
41 42 43 44 45 46 47 48 49 50 51
    - rustc --version
    - cargo --version
    - cargo build --all --color=always
    # FIXME: tests are broken
    # https://github.com/sdroege/gstreamer-sys/issues/16
    # - cargo test --all --color=always
    - cargo build --all --all-features --color=always
    # FIXME: tests are broken
    # https://github.com/sdroege/gstreamer-sys/issues/16
    # - cargo test --all --all-features --color=always

52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73
    # Run tests for crates we can currently run. The others
    # need a new release of the C library first
    - |
        for crate in gstreamer-app-sys \
                     gstreamer-audio-sys \
                     gstreamer-base-sys \
                     gstreamer-check-sys \
                     gstreamer-gl-sys \
                     gstreamer-mpegts-sys \
                     gstreamer-net-sys \
                     gstreamer-pbutils-sys \
                     gstreamer-player-sys \
                     gstreamer-rtsp-sys \
                     gstreamer-sdp-sys \
                     gstreamer-sys \
                     gstreamer-tag-sys \
                     gstreamer-video-sys \
                     gstreamer-webrtc-sys; \
            do \
                cargo test -p $crate; \
            done

Jordan Petridіs's avatar
Jordan Petridіs committed
74
test stable:
75 76 77
  extends:
    - '.cargo test'
    - .img-stable
Jordan Petridіs's avatar
Jordan Petridіs committed
78

79 80 81 82
test 1.40:
  extends:
    - '.cargo test'
    - .img-1-40
83

84 85 86 87
test nightly:
  extends:
    - '.cargo test'
    - .img-nightly
88

89
rustfmt:
90
  extends: .img-stable
91 92 93 94
  stage: "lint"
  script:
    - cargo fmt --version
    - cargo fmt -- --color=always --check