-
Notifications
You must be signed in to change notification settings - Fork 9
/
.gitlab-ci.yml
76 lines (69 loc) · 1.86 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
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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
include: e2e-tests/.gitlab-ci.yml
image: "$CI_REGISTRY/linbit/linbit-admin-backend/test-image"
workflow:
rules:
- if: $CI_COMMIT_TAG
- if: $CI_MERGE_REQUEST_ID
- if: $CI_COMMIT_BRANCH == 'master'
- if: $CI_PIPELINE_SOURCE == 'api'
stages:
- check
- e2e
# Use cargo to test the project
test:cargo:
stage: check
needs: []
variables:
RUSTFLAGS: "-C instrument-coverage"
LLVM_PROFILE_FILE: "coverage-%p-%m.profraw"
script:
- rustc --version && cargo --version # Print version info for debugging
- cargo test --locked -- -Z unstable-options --format json | cargo2junit > results.xml
- grcov . --binary-path ./target/debug/ -s . -t cobertura --branch --ignore-not-existing --ignore "*cargo*" -o coverage.xml
- grcov . --binary-path ./target/debug/ -s . -t lcov --branch --ignore-not-existing --ignore "*cargo*" -o coverage.lcov
- lcov --summary coverage.lcov
artifacts:
reports:
junit:
- results.xml
coverage_report:
coverage_format: cobertura
path: coverage.xml
coverage: '/lines\.*: \d+\.\d+%/'
test:rustfmt:
stage: check
needs: []
script:
- cargo fmt -- --version && cargo fmt -- --print-config current .
- cargo fmt -- --check
test:compat:
stage: check
needs: []
variables:
CARGO_HOME: $CI_PROJECT_DIR/.cargo
parallel:
matrix:
# current 'cargo msrv':
- IMAGE: rust:1.70
image: $IMAGE
script:
- cargo check
cache:
key: $CI_JOB_NAME
paths:
- .cargo
test:clippy:
stage: check
image: $LINBIT_DOCKER_REGISTRY/rust/clippy2codeclimate
variables:
CARGO_HOME: $CI_PROJECT_DIR/.cargo
script:
- cargo clippy --no-deps --all-features --message-format=json | clippy2codeclimate codequality.json
artifacts:
reports:
codequality:
- codequality.json
cache:
key: $CI_JOB_NAME
paths:
- .cargo