forked from trezor/connect
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
183 lines (161 loc) · 4.27 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
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
stages:
- build
- test
- deploy
verify:
stage: build
before_script:
- nix-shell --run "yarn"
script:
- nix-shell --run "yarn test:health"
- nix-shell --run "yarn flow"
- nix-shell --run "yarn typescript"
- nix-shell --run "yarn lint"
- nix-shell --run "yarn test:unit"
tags:
- deploy
build:
stage: build
before_script:
- nix-shell --run "yarn"
script:
- nix-shell --run "yarn build:connect"
artifacts:
expire_in: 1 week
paths:
- build
tags:
- deploy
# Deploy to testing environment
deploy test:
stage: deploy
variables:
GIT_STRATEGY: none
when: manual
needs: ["build"]
environment:
name: $CI_BUILD_REF_NAME
url: $BASE_REVIEW_URL/$CI_BUILD_REF_NAME
before_script: []
script:
- echo "Deploy a review app"
- '[ -z "${DEPLOY_BASE_DIR}" ] && echo "Deploy base dir cannot be empty" && exit 255'
- env
- mkdir -p "${DEPLOY_BASE_DIR}/${CI_BUILD_REF_NAME}"
- echo "Copy dev build to web server ${DEPLOY_BASE_DIR}/${CI_BUILD_REF_NAME}..."
- rsync --delete -va build/ "${DEPLOY_BASE_DIR}/${CI_BUILD_REF_NAME}/"
only:
- branches
tags:
- deploy
# Deploy release to connect.trezor.io
deploy production:
stage: deploy
only:
refs:
- v8
when: manual
needs: ["build"]
variables:
GIT_STRATEGY: none
before_script: []
script:
- nix-shell --run "make sync-8"
tags:
- deploy
# Publish release to npm registry
publish release to npm:
stage: deploy
only:
refs:
- v8
when: manual
needs: []
before_script:
- echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" > ~/.npmrc
script:
- nix-shell --run "yarn && yarn build:npm && cd ./npm && npm publish"
- nix-shell --run "yarn && yarn build:npm-extended && cd ./npm-extended && npm publish --tag extended"
after_script:
- rm ~/.npmrc
tags:
- deploy
# Publish beta release to npm registry
publish beta release to npm:
stage: deploy
when: manual
needs: ["verify"]
before_script:
- echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" > ~/.npmrc
- nix-shell --run "yarn"
- nix-shell --run "REMOTE_VERSION=\$(npm show trezor-connect version --tag beta) && node ./scripts/ci-check-version \$REMOTE_VERSION $CI_COMMIT_BRANCH"
script:
- nix-shell --run "yarn build:npm-extended && cd ./npm-extended && npm publish --tag beta"
after_script:
- rm ~/.npmrc
tags:
- deploy
# Test
.test:
image: registry.gitlab.com/satoshilabs/trezor/trezor-user-env/trezor-user-env:latest
stage: test
needs: ["build"]
variables:
SDL_VIDEODRIVER: "dummy"
TESTS_FIRMWARE: "2-master"
TESTS_USE_TX_CACHE: "false"
TESTS_USE_WS_CACHE: "false"
before_script:
- nix-shell --run "yarn"
script:
- "echo Firmware version: $TESTS_FIRMWARE"
- /trezor-user-env/run.sh &
- nix-shell --run "yarn test:integration --coverage true"
test management:
extends: .test
variables:
TESTS_INCLUDED_METHODS: "applySettings,applyFlags,getFeatures"
test btc sign:
extends: .test
variables:
TESTS_INCLUDED_METHODS: "signTransaction"
test btc others:
extends: .test
variables:
TESTS_INCLUDED_METHODS: "getAccountInfo,getAddress,getPublicKey,signMessage,verifyMessage"
test stellar:
extends: .test
variables:
TESTS_INCLUDED_METHODS: "stellarGetAddress,stellarSignTransaction"
test cardano:
extends: .test
variables:
TESTS_INCLUDED_METHODS: "cardanoGetAddress,cardanoGetPublicKey,cardanoSignTransaction"
test eos:
extends: .test
variables:
TESTS_INCLUDED_METHODS: "eosGetPublicKey,eosSignTransaction"
test eth:
extends: .test
variables:
TESTS_INCLUDED_METHODS: "ethereumGetAddress,ethereumGetPublicKey,ethereumSignMessage,ethereumSignTransaction,ethereumVerifyMessage"
test nem:
extends: .test
variables:
TESTS_INCLUDED_METHODS: "nemGetAddress,nemSignTransaction"
test ripple:
extends: .test
variables:
TESTS_INCLUDED_METHODS: "rippleGetAddress,rippleSignTransaction"
test tezos:
extends: .test
variables:
TESTS_INCLUDED_METHODS: "tezosGetAddress,tezosGetPublicKey"
test binance:
extends: .test
variables:
TESTS_INCLUDED_METHODS: "binanceSignTransaction"
test lisk:
extends: .test
variables:
TESTS_INCLUDED_METHODS: "liskGetAddress,liskSignMessage,liskSignTransaction,liskVerifyMessage"