forked from nimiq/core-rs-albatross
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.gitlab-ci.yml
135 lines (118 loc) · 2.43 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
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
image: 'rust:latest'
variables:
CARGO_HOME: $CI_PROJECT_DIR/cargo
APT_CACHE_DIR: $CI_PROJECT_DIR/apt
stages:
- build
- image
- test
- coverage
- deploy
.build:
stage: build
script:
- rustc --version
- cargo --version
- cargo build --all
artifacts:
paths:
- target/debug/nimiq-client
.test:
stage: test
script:
- rustc --version
- cargo --version
- cargo test --all
.coverage:
stage: coverage
script:
- rustc --version
- cargo --version
- apt-get update -yq
- apt-get install -y cmake libelf-dev libdw-dev binutils-dev libiberty-dev jq
- ./scripts/coverage.sh --all --tests
artifacts:
paths:
- cov/cov
.clippy:
stage: coverage
allow_failure: true
script:
- set +e
- rustup component add clippy
- cargo clippy --all
check-features:
stage: test
only:
- schedules
image: 'rustlang/rust:nightly'
script:
- apt update -yq
- apt install -y python3-pip
- pip3 install toml
- rustc --version
- cargo --version
- scripts/test_features.py --workspace
build-nightly:
extends: .build
image: 'rustlang/rust:nightly'
test-nightly:
extends: .test
image: 'rustlang/rust:nightly'
# dependencies:
# - build-nightly
coverage-nightly:
extends: .coverage
image: 'rustlang/rust:nightly'
clippy-nightly:
extends: .clippy
image: 'rustlang/rust:nightly'
#build-stable:
# extends: .build
#test-stable:
# extends: .test
# dependencies:
# - build-stable
#coverage-stable:
# extends: .coverage
# dependencies:
# - build-stable
.pages:
stage: deploy
script:
- cargo doc --no-deps
- mv target/doc public
- echo '<meta http-equiv="refresh" content="0; url=nimiq">' > public/index.html
artifacts:
paths:
- public
only:
- master
# stable
#pages:
# extends: .pages
# nightly
#pages:
# extends: .pages
# image: 'rustlang/rust:nightly'
docker:
stage: image
image: docker:18
only:
- branches
services:
- docker:18-dind
dependencies:
- build-nightly
before_script:
- docker info
- docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
script:
- >
case "$CI_COMMIT_REF_NAME" in
master) TAG=latest ;;
*) TAG=$(echo $CI_COMMIT_REF_NAME | sed -e 's/\//-/g') ;;
esac
- docker pull $CI_REGISTRY_IMAGE:$TAG || true
- docker build --tag $CI_REGISTRY_IMAGE:$TAG .
- docker push $CI_REGISTRY_IMAGE:$TAG