-
Notifications
You must be signed in to change notification settings - Fork 1
/
.gitlab-ci.yml
39 lines (35 loc) · 935 Bytes
/
.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
32
33
34
35
36
37
38
39
image: "rust:latest"
before_script:
- rustup component add rustfmt
- rustup component add clippy
- rustc --version && cargo --version # Print version info for debugging
.template.code-checks:
variables:
GIT_SUBMODULE_STRATEGY: recursive
CODE_CHECK_DIR: "."
CODE_CHECK_PROFILE_FLAG: ""
# for caching
CARGO_HOME: "$CI_PROJECT_DIR/.cargo"
cache:
key:
files:
- Cargo.lock
- example/Cargo.lock
paths:
- $CARGO_HOME
- target
- example/target
script:
- cd "${CODE_CHECK_DIR}"
- cargo check ${CODE_CHECK_PROFILE_FLAG} --all --verbose
- cargo test ${CODE_CHECK_PROFILE_FLAG} --all --verbose
- cargo fmt --all -- --check
- cargo clippy -- -D warnings
ci-main-workspace:
extends: .template.code-checks
variables:
CODE_CHECK_DIR: "."
ci-example-project:
extends: .template.code-checks
variables:
CODE_CHECK_DIR: "./example"