-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy path.gitlab-ci.yml
More file actions
60 lines (51 loc) · 1.63 KB
/
.gitlab-ci.yml
File metadata and controls
60 lines (51 loc) · 1.63 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
# Setup a cache to cache job parts between jobs to ensure faster builds
cache:
key: "$CI_JOB_NAME"
untracked: true
paths:
- $HOME/.cargo/
- target/
# Define a yaml template for running a build and then running your tests
.cargo_test_template: &cargo_test
script:
- rustc --version && cargo --version
- cargo build
- cargo test --verbose
# Set any required environment variables here
variables:
RUST_BACKTRACE: "FULL"
# Do any pre-flight requirements here, such as updating $PATH installing dependencies
before_script:
- export PATH="$HOME/.cargo/bin:$PATH"
after_script:
# Caching this directory actually slows down build times unnecessarily
# See https://levans.fr/rust_travis_cache.html
- rm -rf $HOME/.cargo/registry
# The following test: stages inherit from the test template above and
# configure the image used for the various Rust release trains
test:stable:
image: "rust:latest"
<<: *cargo_test
# Always want to run rustfmt and clippy against our code, to ensure that
# we aren't using any anti-patterns or failing to follow our style guide
lint:rustfmt:
image: "rust:latest"
script:
- rustup component add rustfmt
- cargo fmt -- --check
lint:clippy:
image: "rust:latest"
script:
- rustup component add clippy
- cargo clippy -- -D warnings # Turn all warnings into errors
# Some nightly canary checks
test:nightly:
image: "rustlang/rust:nightly"
allow_failure: true
<<: *cargo_test
lint:clippy:nightly:
image: "rustlang/rust:nightly"
allow_failure: true
script:
- rustup component add clippy
- cargo +nightly clippy -- -D warnings # Turn all warnings into errors