forked from Blockstream/lwk
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.gitlab-ci.yml
144 lines (126 loc) · 4.04 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
136
137
138
139
140
141
142
143
144
variables:
CI_DISPOSABLE_ENVIRONMENT: "true"
DOCKER_DRIVER: overlay2
DOCKER_HOST: tcp://localhost:2375
DOCKER_TLS_CERTDIR: ""
.base:
image: xenoky/lwk-builder@sha256:5468d3679a1cd2a1ca174ca7792cef62e11dbcedd14fad3e9e937e865e981aee
tags:
- cloud
retry:
max: 2
when:
- runner_system_failure
- unknown_failure
- stuck_or_timeout_failure
services:
- docker:20.10.12-dind
fmt_clippy:
extends: .base
script:
- cp ./context/env.sh / && cd / && . ./env.sh && cd -
- cargo fmt --check
- cargo clippy --all-targets -- -D warnings
test_clean:
image: rust:1.75
script:
- cargo build
test_wollet:
extends: .base
script:
- docker pull xenoky/local-jade-emulator:1.0.27
- cp ./context/env.sh / && cd / && . ./env.sh && cd -
- cargo test -p lwk_wollet -p lwk_signer
test_jade:
extends: .base
variables:
TMPDIR: ${CI_PROJECT_DIR} # otherwise issue with the docker
script:
- docker pull tulipan81/blind_pin_server:v0.0.7
- docker pull xenoky/local-jade-emulator:1.0.27
- cargo test -p lwk_jade
test_ledger:
extends: .base
script:
- cargo test -p lwk_ledger
test_serial:
extends: .base
script:
- cp ./context/env.sh / && cd / && . ./env.sh && cd -
- cargo test --no-run --features serial
# run tests for minor crates all together
test_minor:
extends: .base
script:
- cargo test -p lwk_tiny_jrpc -p lwk_app -p lwk_containers -p lwk_common -p lwk_hwi -p lwk_rpc_model -p lwk_signer
test_cli:
extends: .base
script:
- cp ./context/env.sh / && cd / && . ./env.sh && cd -
- cargo test -p lwk_cli
test_coverage:
extends: .base
variables:
RUSTFLAGS: "-C instrument-coverage"
LLVM_PROFILE_FILE: "coverage-%p-%m.profraw"
TMPDIR: ${CI_PROJECT_DIR} # otherwise issue with the docker
script:
- docker pull tulipan81/blind_pin_server:v0.0.7
- docker pull xenoky/local-jade-emulator:1.0.27
- cp ./context/env.sh / && cd / && . ./env.sh && cd -
- cargo nextest run --features foreign_bindings,asyncr --profile ci
- grcov . -s . --binary-path ./target/debug/ -t cobertura --branch --ignore-not-existing --ignore "*cargo*" -o ./target/coverage.xml -p $(pwd)
- "xmllint --xpath \"concat('Coverage: ', 100 * string(//coverage/@line-rate), ' perc')\" target/coverage.xml"
- grcov . -s . --binary-path ./target/debug/ -t html --branch --ignore-not-existing --ignore "*cargo*" -o ./target/coverage/ -p $(pwd)
coverage: '/Coverage: \d+(?:\.\d+)?/'
artifacts:
paths:
- target/coverage.xml
- target/coverage/
- target/nextest/ci/junit.xml
reports:
coverage_report:
coverage_format: cobertura
path: target/coverage.xml
junit: target/nextest/ci/junit.xml
build_cli:
extends: .base
only:
- master@liquid/lwk
script:
- cargo build --release -p lwk_cli
artifacts:
paths:
- target/release/lwk_cli
when: always
expire_in: 14 days
audit:
extends: .base
script:
# ignore unmantained serde_cbor
- cargo audit -D warnings --ignore RUSTSEC-2021-0127
doc:
extends: .base
variables:
RUSTDOCFLAGS: "-D warnings --cfg docsrs"
script:
- cp ./context/env.sh / && cd / && . ./env.sh && cd -
- cargo +nightly doc --all-features --no-deps
examples:
extends: .base
script:
- cargo run --example list_transactions
bindings:
extends: .base
script:
- cp ./context/env.sh / && cd / && . ./env.sh && cd -
- cargo test -p lwk_bindings --features foreign_bindings
wasm:
extends: .base
script:
- cp ./context/env.sh / && cd / && . ./env.sh && cd -
- cargo check --target wasm32-unknown-unknown -p lwk_common -p lwk_rpc_model -p lwk_containers -p lwk_hwi
- cargo check --target wasm32-unknown-unknown -p lwk_wollet --no-default-features --features esplora_wasm
- cargo check --target wasm32-unknown-unknown -p lwk_signer --no-default-features
- cargo check --target wasm32-unknown-unknown -p lwk_jade --no-default-features --features asyncr
- cd lwk_wasm && WASM_BINDGEN_TEST_TIMEOUT=60 wasm-pack test --chrome --headless