-
-
Notifications
You must be signed in to change notification settings - Fork 3
/
.gitlab-ci.yml
45 lines (37 loc) · 961 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
40
41
42
43
44
45
image: "rust:latest"
stages:
- lint
- test
variables:
CARGO_HOME: $CI_PROJECT_DIR/cargo
lint:fmt:
stage: lint
before_script:
- rustup component add rustfmt
script:
- cargo fmt -- --check
lint:clippy:
stage: lint
before_script:
- apt update -yqq
- apt install -yqq --no-install-recommends libgtk-3-dev
- rustup component add clippy
script: cargo clippy --all-features -- --deny warnings
.test: &test
stage: test
before_script:
- apt update -yqq
- apt install -yqq --no-install-recommends libgtk-3-dev
- MODE=$(echo "$CI_JOB_NAME" | cut -d ':' -f 2)
- test "$MODE" == "release" && CARGO_FLAGS='--release' || CARGO_FLAGS=''
script:
- rustc --version && cargo --version
- cargo test --all-features $CARGO_FLAGS
test:debug:
<<: *test
test:release:
<<: *test
cache:
paths:
- $CARGO_HOME
- target/