-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy path.gitlab-ci.yml
31 lines (28 loc) · 1.11 KB
/
.gitlab-ci.yml
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
# Thanks to the following blog post we are caching cargo
# http://blog.wjlr.org.uk/2016/08/16/fast-rust-gitlab-ci.html
# This file is a template, and might need editing before it works on your project.
image: "rust"
# To ensure that dependencies are cached correctly
variables:
CARGO_HOME: $CI_PROJECT_DIR/cargo
# Use cargo to test the project
test:cargo:
before_script:
- apt-get update
# - apt-get install -y packagename
script:
- du -hs target || true
- du -hs cargo || true
- rustup toolchain list || true
- rustup component add rustfmt || true
- rustc --version && cargo --version # Print version info for debugging
- export RUST_BACKTRACE=1
- time cargo update
- time cargo build --all --all-targets --verbose --release # --all builds whole workspace, --all-targets builds bin,lib,examples,tests,benchmarks
# cargo fmt fails if modules generated by build.rs are not there yet
- time cargo fmt --all -- --check
- time cargo test --all --verbose --jobs 1 --release # Don't parallelize to make errors more readable
cache:
paths:
- target/
- cargo/