-
Notifications
You must be signed in to change notification settings - Fork 1
/
.gitlab-ci.yml
232 lines (207 loc) · 6.33 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
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
include:
- project: TankerHQ/gitlab-ci-files
ref: 2024-07-29-279
file: /common.yml
variables:
SDK_NATIVE_CONAN_REFERENCE: tanker/latest-stable@
GIT_DEPTH: 1
############
# Workflow #
############
workflow:
rules:
# web pipelines for releases only
- if: $CI_PIPELINE_SOURCE == "web" && $SDK_REACT_NATIVE_RELEASE_VERSION !~ /\A\d+\.\d+\.\d+(-(alpha|beta)\d+)?\z/
when: never
# we must specify version of sdk-ios/sdk-android to avoid clients upgrading them by accident
- if: $CI_PIPELINE_SOURCE == "web" && $SDK_ANDROID_RELEASE_VERSION !~ /\A\d+\.\d+\.\d+(-(alpha|beta)-\d+)?\z/
when: never
- if: $CI_PIPELINE_SOURCE == "web" && $SDK_IOS_RELEASE_VERSION !~ /\A\d+\.\d+\.\d+(-(alpha|beta)\d+)?\z/
when: never
- if: !reference [.if-invalid-native-conan-reference, if]
when: never
- if: '$CI_MERGE_REQUEST_TITLE =~ /.*\[preview].*/'
variables:
CONAN_REMOTE: "artifactory-preview"
- when: always
variables:
CONAN_REMOTE: "artifactory"
###########
# Default #
###########
default:
before_script:
- poetry run python -m pip install --upgrade pip
- poetry install
image: registry.gitlab.com/tankerhq/docker/sdk-react-native:latest
.before-script/download-artifacts:
before_script:
- !reference [default, before_script]
- poetry run python run-ci.py download-artifacts --project-id=$UPSTREAM_PROJECT_ID --pipeline-id=$UPSTREAM_PIPELINE_ID --job-name=$UPSTREAM_JOB_NAME
- poetry run python run-ci.py reset-branch $(cat branch_name.txt)
- poetry run python -m pip install --upgrade pip
- poetry install
.artifacts:
artifacts:
when: always
paths:
- logcat.txt
- screenshot.png
##########
# Stages #
##########
stages:
- lint
- check
- deploy
########
# Jobs #
########
lint:
stage: lint
rules:
- !reference [.rules/mr/auto, rules]
- !reference [.rules/web/auto, rules]
- !reference [.rules/push-master-or-feat, rules]
script:
- poetry run python run-ci.py lint
tags: !reference [.tags/linux, tags]
.detox/android:
stage: check
needs: []
extends:
- .artifacts
before_script:
- !reference [default, before_script]
- sudo chgrp 1000 -f /dev/kvm
tags: !reference [.tags/compilation-linux, tags]
detox/android/from-sources:
extends:
- .detox/android
- .rules/mr/manual
script:
- poetry run python run-ci.py prepare android --isolate-conan-user-home --remote $CONAN_REMOTE --use-tanker=deployed --tanker-ref=$SDK_NATIVE_LATEST_CONAN_REFERENCE
- poetry run python run-ci.py detox android --os-version $OS_VERSION --react-native-arch $RN_ARCH
parallel:
matrix:
- OS_VERSION: ["oldest", "latest"]
RN_ARCH: ["old", "new"]
detox/android/all-from-sources:
extends:
- .detox/android
- .rules/native-from-sources
script:
- poetry run python run-ci.py prepare android --isolate-conan-user-home --remote $CONAN_REMOTE --use-tanker=same-as-branch
- poetry run python run-ci.py detox android --os-version $OS_VERSION --react-native-arch $RN_ARCH
parallel:
matrix:
- OS_VERSION: ["oldest", "latest"]
RN_ARCH: ["old", "new"]
detox/android/deployed:
extends:
- .detox/android
rules:
- !reference [.rules/web/auto, rules]
- !reference [.rules/mr/manual, rules]
script:
- poetry run python run-ci.py detox android --os-version $OS_VERSION --react-native-arch $RN_ARCH
parallel:
matrix:
- OS_VERSION: ["oldest", "latest"]
RN_ARCH: ["old", "new"]
detox/android/downstream:
extends:
- .detox/android
- .rules/check/downstream/android
before_script:
- !reference [.before-script/download-artifacts, before_script]
- !reference [.detox/android, before_script]
script:
- poetry run python run-ci.py detox android
.detox/ios:
stage: check
needs: []
extends:
- .artifacts
detox/ios/from-sources:
extends:
- .detox/ios
- .rules/mr/manual
script:
- poetry run python run-ci.py prepare ios --isolate-conan-user-home --remote $CONAN_REMOTE --use-tanker=deployed --tanker-ref=$SDK_NATIVE_LATEST_CONAN_REFERENCE
- poetry run python run-ci.py detox ios --react-native-arch $RN_ARCH
parallel:
matrix:
- RN_ARCH: ["old", "new"]
CPU_ARCH: ["arm", "x86_64"]
tags:
- macos
- $CPU_ARCH
detox/ios/all-from-sources:
extends:
- .detox/ios
- .rules/mr/manual
script:
- poetry run python run-ci.py prepare ios --isolate-conan-user-home --remote $CONAN_REMOTE --use-tanker=same-as-branch
- poetry run python run-ci.py detox ios --react-native-arch $RN_ARCH
parallel:
matrix:
- RN_ARCH: ["old", "new"]
CPU_ARCH: ["arm", "x86_64"]
tags:
- macos
- $CPU_ARCH
detox/ios/deployed:
extends:
- .detox/ios
rules:
- !reference [.rules/web/auto, rules]
- !reference [.rules/mr/manual, rules]
script:
- poetry run python run-ci.py detox ios --react-native-arch $RN_ARCH
parallel:
matrix:
- RN_ARCH: ["old", "new"]
CPU_ARCH: ["arm", "x86_64"]
tags:
- macos
- $CPU_ARCH
detox/ios/downstream/arm:
extends:
- .detox/ios
- .rules/check/downstream/ios/arm
- .before-script/download-artifacts
script:
- poetry run python run-ci.py detox ios --react-native-arch $RN_ARCH
parallel:
matrix:
- RN_ARCH: ["old"]
tags: !reference [.tags/macos/arm, tags]
detox/ios/downstream/x86_64:
extends:
- .detox/ios
- .rules/check/downstream/ios/x86_64
- .before-script/download-artifacts
script:
- poetry run python run-ci.py detox ios --react-native-arch $RN_ARCH
parallel:
matrix:
- RN_ARCH: ["old"]
tags: !reference [.tags/macos/x86_64, tags]
################
# deploy stage #
################
deploy:
stage: deploy
extends:
- .rules/deploy/react-native
script:
- echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" > "${HOME}/.npmrc"
- poetry run python run-ci.py reset-branch $UPSTREAM_BRANCH_NAME
- poetry run python run-ci.py patch-sdk-version android $SDK_ANDROID_RELEASE_VERSION
- poetry run python run-ci.py patch-sdk-version ios $SDK_IOS_RELEASE_VERSION
- poetry run python run-ci.py deploy --version $SDK_REACT_NATIVE_RELEASE_VERSION
release:
description: sdk-react-native v$SDK_REACT_NATIVE_RELEASE_VERSION
tag_name: v$SDK_REACT_NATIVE_RELEASE_VERSION
tags: !reference [.tags/linux, tags]