Commit 770d3b96 authored by Ben Boeckel's avatar Ben Boeckel Committed by Kitware Robot

Merge topic 'gitlab-ci-with-sccache'

85f7fbff gitlab-ci: vendor used dependencies
19a81f8e gitlab-ci: use sccache
91482325 gitlab-ci: refactor out clippy job configuration
52c4b873 gitlab-ci: add script to download sccache
Acked-by: Kitware Robot's avatarKitware Robot <kwrobot@kitware.com>
Merge-request: !74
parents 1dd0e253 85f7fbff
Pipeline #150822 passed with stages
in 8 minutes and 27 seconds
......@@ -13,10 +13,24 @@ before_script:
.cargo_update: &cargo_update
- cargo generate-lockfile $GENERATE_LOCKFILE_ARGS
- cargo fetch --locked
- mkdir .cargo
- cargo vendor > .cargo/config
.cargo_clippy: &cargo_clippy
# Only use it if it's available; no need to fail the build due to something
# gone wrong here.
- .gitlab/ci/sccache.sh && export RUSTC_WRAPPER=$PWD/.gitlab/sccache
- rustup component add clippy
- cargo clippy --frozen --tests --all --verbose -- -D warnings
- ".gitlab/sccache --show-stats || :"
.cargo_build: &cargo_build
# Only use it if it's available; no need to fail the build due to something
# gone wrong here.
- .gitlab/ci/sccache.sh && export RUSTC_WRAPPER=$PWD/.gitlab/sccache
- cargo build $CARGO_BUILD_FROZEN --all --verbose
- cargo test --frozen --all --no-run --verbose
- ".gitlab/sccache --show-stats || :"
.cargo_test: &cargo_test
- apt-get install -yqq --no-install-recommends git
......@@ -32,6 +46,7 @@ before_script:
# remove this variable.
#CARGO_BUILD_FROZEN: --frozen
CARGO_UPDATE_POLICY: newest
SCCACHE_REDIS: redis://minmus:6379
.rust_stable: &rust_stable
image: "rust:latest"
......@@ -39,6 +54,7 @@ before_script:
variables:
CARGO_BUILD_FROZEN: --frozen
CARGO_UPDATE_POLICY: newest
SCCACHE_REDIS: redis://minmus:6379
.rust_nightly: &rust_nightly
extends: .rust_stable
......@@ -52,7 +68,8 @@ before_script:
artifacts:
expire_in: 60m
paths:
- .cargo-cache
- vendor
- .cargo
- Cargo.lock
cache:
key: cargo-cache-$CARGO_UPDATE_POLICY
......@@ -60,6 +77,12 @@ before_script:
- .cargo-cache
interruptible: true
.cargo_clippy_job: &cargo_clippy_job
stage: build
tags: *rust_tags
script: *cargo_clippy
interruptible: true
.cargo_build_job: &cargo_build_job
stage: build
tags: *rust_tags
......@@ -67,13 +90,10 @@ before_script:
artifacts:
expire_in: 60m
paths:
- .cargo-cache
- vendor
- .cargo
- Cargo.lock
- target
cache:
key: build-cache-$CI_JOB_NAME
paths:
- target
interruptible: true
.cargo_test_job: &cargo_test_job
......@@ -108,12 +128,9 @@ prepare:cargo-cache-mindeps:
build:cargo-clippy:
<<:
- *cargo_build_job
- *cargo_clippy_job
- *rust_stable
- *cargo_cache_newest
script:
- rustup component add clippy
- cargo clippy --frozen --tests --all --verbose -- -D warnings
build:cargo-minimum:
<<:
......
#!/bin/sh
set -e
readonly version="0.2.12"
readonly sha256sum="26fd04c1273952cc2a0f359a71c8a1857137f0ee3634058b3f4a63b69fc8eb7f"
readonly filename="sccache-$version-x86_64-unknown-linux-musl"
readonly tarball="$filename.tar.gz"
cd .gitlab
echo "$sha256sum $tarball" > sccache.sha256sum
curl -OL "https://github.com/mozilla/sccache/releases/download/$version/$tarball"
sha256sum --check sccache.sha256sum
tar xf "$tarball"
mv "$filename/sccache" .
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment