This repository has been archived by the owner on Sep 1, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
98 lines (86 loc) · 1.8 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
88
89
90
91
92
93
94
95
96
97
98
# https://hub.docker.com/r/library/rust/tags/
image: "rust:latest"
# Optional: Pick zero or more services to be used on all builds.
# Only needed when using a docker container to run your tests in.
# Check out: http://docs.gitlab.com/ee/ci/docker/using_docker_images.html#what-is-a-service
# services:
# - mysql:latest
# - redis:latest
# - postgres:latest
variables:
SQLX_OFFLINE: "true"
stages:
- check
- build
- test
- deploy
.update-rust: &update-rust
- rustup update
- cargo update
.check-rust: &check-rust
- rustc --version
- cargo --version
default:
before_script:
- cd coin-market-cap
- *check-rust
- cargo install sqlx-cli --no-default-features --features postgres
check-all:
stage: check
script:
- rustup component add clippy
- cargo clippy -- -D warnings
cache:
key: "$CI_COMMIT_REF_SLUG"
paths:
- Cargo.lock
- target/
build-all:
stage: build
script:
- cargo build --verbose
cache:
key: "$CI_COMMIT_REF_SLUG"
paths:
- Cargo.lock
- target/
test-all-mr:
stage: test
script:
- cargo install cargo-tarpaulin
- cargo tarpaulin -v -- --skip update
coverage: /\d+.\d+% coverage/
cache:
key: "$CI_JOB_NAME-$CI_COMMIT_REF_SLUG"
paths:
- Cargo.lock
- target/
only:
- merge_requests
test-all-main:
stage: test
script:
- cargo install cargo-tarpaulin
- cargo tarpaulin -v -- --skip update
coverage: /\d+.\d+% coverage/
cache:
key: "$CI_JOB_NAME-$CI_COMMIT_REF_SLUG"
paths:
- Cargo.lock
- target/
only:
- main
deploy-all:
stage: deploy
script:
- cargo build --release --verbose
cache:
key: "$CI_JOB_NAME"
paths:
- Cargo.lock
- target/
artifacts:
paths:
- ../target/release/coin-market-cap*
only:
- main