.gitlab-ci.yml 3 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
  - "test"
7
  - "extras"
Jordan Petridіs's avatar
Jordan Petridіs committed
8

9 10 11 12 13 14 15 16 17 18
.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
19 20 21 22 23 24
    # If cargo exists assume we probably will want to update the lockfile
    - |
      if command -v cargo; then
        cargo generate-lockfile
        cargo update
      fi
Jordan Petridіs's avatar
Jordan Petridіs committed
25 26 27
  cache:
    key: "gst"
    paths:
28
      - "${CARGO_HOME}"
Jordan Petridіs's avatar
Jordan Petridіs committed
29

30 31
.img-stable:
  extends: .base
Jordan Petridіs's avatar
Jordan Petridіs committed
32
  variables:
33
    RUST_VERSION: "stable"
Jordan Petridіs's avatar
Jordan Petridіs committed
34

35 36 37 38
.img-1-40:
  extends: .base
  variables:
    RUST_VERSION: "1.40.0"
Jordan Petridіs's avatar
Jordan Petridіs committed
39

40 41 42 43
.img-nightly:
  extends: .base
  variables:
    RUST_VERSION: "nightly"
44

45 46 47
.cargo test:
  stage: "test"
  script:
Jordan Petridіs's avatar
Jordan Petridіs committed
48 49
    - rustc --version
    - cargo --version
50
    - cargo build --locked --all --color=always
Jordan Petridіs's avatar
Jordan Petridіs committed
51 52
    # FIXME: tests are broken
    # https://github.com/sdroege/gstreamer-sys/issues/16
53 54
    # - cargo test --locked --all --color=always
    - cargo build --locked --all --all-features --color=always
Jordan Petridіs's avatar
Jordan Petridіs committed
55 56
    # FIXME: tests are broken
    # https://github.com/sdroege/gstreamer-sys/issues/16
57
    # - cargo test --locked --all --all-features --color=always
Jordan Petridіs's avatar
Jordan Petridіs committed
58

59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77
    # 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 \
78
                cargo test --locked -p $crate; \
79 80
            done

Jordan Petridіs's avatar
Jordan Petridіs committed
81
test stable:
82 83 84
  extends:
    - '.cargo test'
    - .img-stable
Jordan Petridіs's avatar
Jordan Petridіs committed
85

86 87 88 89
test 1.40:
  extends:
    - '.cargo test'
    - .img-1-40
90

91 92 93 94
test nightly:
  extends:
    - '.cargo test'
    - .img-nightly
95

96
rustfmt:
97
  extends: .img-stable
98 99 100 101
  stage: "lint"
  script:
    - cargo fmt --version
    - cargo fmt -- --color=always --check
102

103 104 105 106 107 108
check commits:
  extends: .img-stable
  stage: "lint"
  script:
    - ci-fairy check-commits --textwidth 0 --no-signed-off-by

109 110 111 112 113 114 115 116
outdated:
  extends: .img-stable
  allow_failure: true
  stage: 'extras'
  only:
    - schedules
  script:
    - cargo outdated --root-deps-only --exit-code 1 -v
117 118 119 120 121 122 123 124

deny:
  extends: .img-stable
  stage: 'extras'
  only:
    - schedules
  script:
    - cargo deny check