Repository navigation
Expand file tree
/
Copy path.gitlab-ci.yml
More file actions
190 lines (173 loc) · 7.83 KB
/
Copy path.gitlab-ci.yml
File metadata and controls
190 lines (173 loc) · 7.83 KB
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
include:
- 'https://gitlab-templates.ddbuild.io/slack-notifier/v3-sdm/template.yml'
# SETUP
variables:
GIT_DEPTH: 5
DEVELOP_BRANCH: 'develop'
DEVELOPER_DIR: '/Applications/Xcode-16.4.0.app/Contents/Developer'
IOS_SIMULATOR_DESTINATION: 'platform=iOS Simulator,OS=18.5,name=iPhone 16 Pro Max'
IOS_DERIVED_DATA_PATH: '$CI_PROJECT_DIR/DerivedData'
ANDROID_SDK_VERSION: 'commandlinetools-mac-11076708_latest'
EMULATOR_NAME: 'android_emulator'
ANDROID_ARCH: 'arm64-v8a'
ANDROID_API: '35'
ANDROID_EMULATOR_IMAGE: 'system-images;android-$ANDROID_API;google_apis;${ANDROID_ARCH}'
ANDROID_PLATFORM: 'platforms;android-$ANDROID_API'
ANDROID_BUILD_TOOLS: 'build-tools;$ANDROID_API.0.0'
# KUBERNETES_MEMORY_REQUEST: "8Gi"
# KUBERNETES_MEMORY_LIMIT: "13Gi"
stages:
- benchmark
- test
- build-examples
- notify
.snippets:
install-jdk-17:
- brew install openjdk@17
install-android-sdk:
- curl -sSL -o commandlinetools.zip https://dl.google.com/android/repository/$ANDROID_SDK_VERSION.zip
- rm -rf ~/android_sdk
- rm -rf ~/cmdline-tools
- unzip -q commandlinetools -d ~/
- mkdir -p ~/android_sdk/cmdline-tools/latest
- mv ~/cmdline-tools/* ~/android_sdk/cmdline-tools/latest
- rm ./commandlinetools.zip
- export ANDROID_HOME="$HOME/android_sdk/"
- export ANDROID_SDK_ROOT="$HOME/android_sdk/"
- echo y | ~/android_sdk/cmdline-tools/latest/bin/sdkmanager --install "emulator"
- echo y | ~/android_sdk/cmdline-tools/latest/bin/sdkmanager --install "platform-tools"
- echo y | ~/android_sdk/cmdline-tools/latest/bin/sdkmanager --install "$ANDROID_PLATFORM"
- echo y | ~/android_sdk/cmdline-tools/latest/bin/sdkmanager --install "$ANDROID_BUILD_TOOLS"
- echo y | ~/android_sdk/cmdline-tools/latest/bin/sdkmanager --install "$ANDROID_EMULATOR_IMAGE"
- yes | ~/android_sdk/cmdline-tools/latest/bin/sdkmanager --licenses || true
- echo "no" | ~/android_sdk/cmdline-tools/latest/bin/avdmanager --verbose create avd --force --name "$EMULATOR_NAME" --package "$ANDROID_EMULATOR_IMAGE"
# TESTS
test:lint:
tags: ['macos:sequoia-arm64', 'specific:true']
stage: test
rules:
- if: '$BUILD_BENCHMARK != "true"'
timeout: 1h
script:
- yarn
- yarn run lint
test:js:
tags: ['macos:sequoia-arm64', 'specific:true']
stage: test
rules:
- if: '$BUILD_BENCHMARK != "true"'
timeout: 1h
script:
- yarn
- cp jestSetup.js.override node_modules/react-native-gesture-handler/jestSetup.js
- NODE_OPTIONS='-r dd-trace/ci/init' DD_ENV=ci DD_SERVICE=dd-sdk-reactnative yarn test
test:build:
tags: ['macos:sequoia-arm64', 'specific:true']
stage: test
rules:
- if: '$BUILD_BENCHMARK != "true"'
timeout: 1h
script:
- yarn
- yarn prepare
test:native-android:
tags: ['macos:sequoia-arm64', 'specific:true']
stage: test
rules:
- if: '$BUILD_BENCHMARK != "true"'
timeout: 1h
script:
- !reference [.snippets, install-android-sdk]
- !reference [.snippets, install-jdk-17]
- /opt/homebrew/opt/openjdk@17/bin/java --version
- echo "org.gradle.java.home=/opt/homebrew/opt/openjdk@17" >> packages/core/android/gradle.properties
- echo "org.gradle.java.home=/opt/homebrew/opt/openjdk@17" >> packages/react-native-session-replay/android/gradle.properties
- echo "org.gradle.java.home=/opt/homebrew/opt/openjdk@17" >> packages/internal-testing-tools/android/gradle.properties
- yarn
- (cd packages/core/android && ./gradlew build -PDdSdkReactNative_minSdkVersion=24)
- (cd packages/react-native-session-replay/android && ./gradlew build -PDdSdkReactNative_minSdkVersion=24 -PDatadogSDKReactNativeSessionReplay_minSdkVersion=24)
- (cd packages/internal-testing-tools/android && ./gradlew build -PDdSdkReactNative_minSdkVersion=24 -PDatadogInternalTesting_minSdkVersion=24)
test:native-ios:
tags: ['macos:sequoia-arm64', 'specific:true']
stage: test
rules:
- if: '$BUILD_BENCHMARK != "true"'
timeout: 1h
script:
- yarn
- (cd example/ios && RCT_NEW_ARCH_ENABLED=0 pod install --repo-update)
- set -o pipefail && xcodebuild -workspace example/ios/DdSdkReactNativeExample.xcworkspace -scheme DatadogSDKReactNative test -destination "$IOS_SIMULATOR_DESTINATION" -derivedDataPath "$IOS_DERIVED_DATA_PATH" | xcbeautify
test:native-ios-sr:
tags: ['macos:sequoia-arm64', 'specific:true']
stage: test
rules:
- if: '$BUILD_BENCHMARK != "true"'
timeout: 1h
script:
- yarn
- (cd example/ios && RCT_NEW_ARCH_ENABLED=0 pod install --repo-update)
- set -o pipefail && xcodebuild -workspace example/ios/DdSdkReactNativeExample.xcworkspace -scheme DatadogSDKReactNativeSessionReplay test -destination "$IOS_SIMULATOR_DESTINATION" -derivedDataPath "$IOS_DERIVED_DATA_PATH" | xcbeautify
test:native-ios-newarch:
tags: ['macos:sequoia-arm64', 'specific:true']
stage: test
rules:
- if: '$BUILD_BENCHMARK != "true"'
timeout: 1h
script:
- yarn
- (cd example-new-architecture/ios && RCT_NEW_ARCH_ENABLED=1 pod install --repo-update)
- set -o pipefail && xcodebuild -workspace example-new-architecture/ios/DdSdkReactNativeExample.xcworkspace -scheme DatadogSDKReactNative test -destination "$IOS_SIMULATOR_DESTINATION" -derivedDataPath "$IOS_DERIVED_DATA_PATH" | xcbeautify
build-examples:android:
tags: ['macos:sequoia-arm64', 'specific:true']
stage: build-examples
rules:
- if: '$BUILD_BENCHMARK != "true"'
timeout: 1h
script:
- !reference [.snippets, install-android-sdk]
- !reference [.snippets, install-jdk-17]
- echo "org.gradle.java.home=/opt/homebrew/opt/openjdk@17" >> example/android/gradle.properties
- yarn
- (cd example/android && ./gradlew assembleDebug)
build-examples:android-newarch:
tags: ['macos:sequoia-arm64', 'specific:true']
stage: build-examples
rules:
- if: '$BUILD_BENCHMARK != "true"'
timeout: 1h
script:
- !reference [.snippets, install-android-sdk]
- !reference [.snippets, install-jdk-17]
- echo "org.gradle.java.home=/opt/homebrew/opt/openjdk@17" >> example-new-architecture/android/gradle.properties
- yarn
- (cd example-new-architecture/android && ./gradlew assembleDebug)
build-examples:ios:
tags: ['macos:sequoia-arm64', 'specific:true']
stage: build-examples
rules:
- if: '$BUILD_BENCHMARK != "true"'
timeout: 1h
script:
- yarn
- (cd example/ios && RCT_NEW_ARCH_ENABLED=0 pod install --repo-update)
- set -o pipefail && xcodebuild -workspace example/ios/DdSdkReactNativeExample.xcworkspace -scheme DdSdkReactNativeExample -configuration Debug -sdk iphonesimulator -destination "$IOS_SIMULATOR_DESTINATION" -derivedDataPath "$IOS_DERIVED_DATA_PATH" build | xcbeautify
build-examples:ios-newarch:
tags: ['macos:sequoia-arm64', 'specific:true']
stage: build-examples
rules:
- if: '$BUILD_BENCHMARK != "true"'
timeout: 1h
script:
- yarn
- (cd example-new-architecture/ios && RCT_NEW_ARCH_ENABLED=1 pod install --repo-update)
- set -o pipefail && xcodebuild -workspace example-new-architecture/ios/DdSdkReactNativeExample.xcworkspace -scheme DdSdkReactNativeExample -configuration Debug -sdk iphonesimulator -destination "$IOS_SIMULATOR_DESTINATION" -derivedDataPath "$IOS_DERIVED_DATA_PATH" build | xcbeautify
benchmark:
stage: benchmark
rules:
- if: '$BUILD_BENCHMARK == "true"'
allow_failure: true
- if: '$CI_COMMIT_BRANCH == $DEVELOP_BRANCH'
allow_failure: true
trigger:
include: 'benchmarks/.benchmarks-ci.yml'
strategy: depend