-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.gitlab-ci.yml
87 lines (80 loc) · 2.29 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
77
78
79
80
81
82
83
84
85
86
87
# test:
# build_images:
# deploy_helm_chart:
---
workflow:
auto_cancel:
on_new_commit: interruptible
rules:
- if: '$CI_PIPELINE_SOURCE == "merge_request_event"'
when: never
- when: always
image: "rust:1"
.base:
variables:
CARGO_HOME: $CI_PROJECT_DIR/.cargo
before_script:
- apt-get update -yqq
- apt-get install -yqq --no-install-recommends build-essential cmake
- export PATH="$PATH:$CARGO_HOME/bin"
- rustc --version && cargo --version
cache:
key: shared-cache
paths: [.cargo/registry/index, .cargo/registry/cache, .cargo/git/db]
rules:
- changes:
- "**/*.rs"
- "**/Cargo.*"
- .gitlab-ci.yml
- ci/*
test:clippy:
interruptible: true
stage: build
extends: .base
script:
- rustup component add clippy
- cargo clippy
# test:cargo:
# stage: build
# extends: .base
# # variables:
# # DATABASE_URL: "postgres://app:$POSTGRES_PASSWORD@postgres/app"
# # KUBIA_ENDPOINT: http://localhost:8080
# services:
# # - name: postgis/postgis:14-3.2
# # alias: postgres
# # variables:
# # POSTGRES_DB: app
# # POSTGRES_USER: app
# # POSTGRES_PASSWORD: app
# # POSTGRES_HOST_AUTH_METHOD: trust
# script:
# - cargo run --bin kubia-server task migrate
# - cargo test --workspace --verbose
# test:coverage:
# extends: test:cargo
# variables:
# RUSTFLAGS: "-C instrument-coverage"
# LLVM_PROFILE_FILE: "coverage-%p-%m.profraw"
# script:
# - apt-get install -yqq pip lcov
# - pip3 install lcov_cobertura
# - rustup component add llvm-tools-preview
# - cargo install grcov || true
# - cargo test --workspace --verbose
# # generate html report
# - grcov . --binary-path ./target/debug/ -s . -t html --branch --ignore-not-existing --ignore "*cargo*" -o ./coverage/
# # generate cobertura report for gitlab integration
# - grcov . --binary-path ./target/debug/ -s . -t lcov --branch --ignore-not-existing --ignore "*cargo*" -o coverage.lcov
# - lcov_cobertura coverage.lcov
# # output coverage summary for gitlab parsing
# - lcov --summary coverage.lcov
# coverage: '/lines\.*:\s*(\d+.\d+)%/'
# artifacts:
# paths:
# - 'coverage'
# reports:
# coverage_report:
# coverage_format: cobertura
# path: coverage.xml
# interruptible: true