CI: abstract the setup needed compile the crates

This commit is contained in:
Jordan Petridis 2018-11-09 18:36:36 +02:00
parent 811e8c1dba
commit 9d5347d7b5
No known key found for this signature in database
GPG key ID: 902CC06D159744F5

View file

@ -2,15 +2,11 @@ stages:
- "lint" - "lint"
- "test" - "test"
.cargo_cache: &cache .tarball_setup: &setup
cache:
key: "gst"
paths:
- ".cargo_cache/"
.cargo_test_template: &cargo_test
stage: "test"
variables: 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"
DEPENDENCIES: | DEPENDENCIES: |
curl curl
liborc-dev liborc-dev
@ -22,16 +18,10 @@ stages:
libgl1-mesa-dri libgl1-mesa-dri
libgl1-mesa-glx libgl1-mesa-glx
libwayland-egl1-mesa libwayland-egl1-mesa
<<: *cache
before_script: before_script:
- apt-get update -yqq - apt-get update -yqq
- apt-get install -yqq --no-install-recommends $DEPENDENCIES - apt-get install -yqq --no-install-recommends $DEPENDENCIES
# Only stuff inside the repo directory can be cached
# Override the CARGO_HOME variable to force its location
- export CARGO_HOME="${PWD}/.cargo_cache"
- mkdir -p precompiled-gst && cd precompiled-gst - mkdir -p precompiled-gst && cd precompiled-gst
- curl -L https://people.freedesktop.org/~slomo/gstreamer-1.14.3.tar.gz | tar xz - curl -L https://people.freedesktop.org/~slomo/gstreamer-1.14.3.tar.gz | tar xz
@ -41,6 +31,16 @@ stages:
- export GST_PLUGIN_SCANNER=$PWD/gstreamer/libexec/gstreamer-1.0/gst-plugin-scanner - export GST_PLUGIN_SCANNER=$PWD/gstreamer/libexec/gstreamer-1.0/gst-plugin-scanner
- export PATH=$PATH:$PWD/gstreamer/bin - export PATH=$PATH:$PWD/gstreamer/bin
- export LD_LIBRARY_PATH=$PWD/gstreamer/lib/x86_64-linux-gnu:$LD_LIBRARY_PATH - export LD_LIBRARY_PATH=$PWD/gstreamer/lib/x86_64-linux-gnu:$LD_LIBRARY_PATH
- cd "${CI_PROJECT_DIR}"
cache:
key: "gst"
paths:
- "${CARGO_HOME}"
.cargo_test_template: &cargo_test
stage: "test"
<<: *setup
script: script:
- rustc --version - rustc --version
- cargo build --color=always --all - cargo build --color=always --all