-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path.gitlab-ci.yml
46 lines (37 loc) · 954 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
46
image: "rust:latest"
variables:
CARGO_HOME: $CI_PROJECT_DIR/cargo
stages:
- lint
- test
lint:fmt:
stage: lint
before_script:
- rustup component add rustfmt
script:
- cargo fmt -- --check
lint:clippy:
stage: lint
before_script:
- rustup component add clippy
script:
- cargo clippy --features mock -- --deny warnings
.test: &test
stage: test
before_script:
- MODE=$(echo "$CI_JOB_NAME" | cut -d ':' -f 2)
- test "$MODE" == "release" && CARGO_FLAGS='--release' || CARGO_FLAGS=''
script:
- cargo test --features mock --jobs 1 $CARGO_FLAGS --package rp-sys
- cargo test --features mock --jobs 1 $CARGO_FLAGS
test:debug:
<<: *test
test:release:
<<: *test
mock:
script:
- exit $(diff <(grep -R 'pub fn ' rp-sys/src/) <(grep -R 'pub fn ' rp-sys/mock/src/ | sed 's/^mock\///') | wc -l)
cache:
paths:
- $CARGO_HOME
- target/