-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdev.yml
More file actions
289 lines (272 loc) · 10.7 KB
/
dev.yml
File metadata and controls
289 lines (272 loc) · 10.7 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
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
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
name: checkout-kit
up:
- packages:
- quicktype
- rover
- mint
- xcbeautify
- jq
- swiftlint
- sccache
- ruby
- custom:
name: Install bundle packages
met?: BUNDLE_GEMFILE=platforms/swift/Gemfile bundle check
meet: BUNDLE_GEMFILE=platforms/swift/Gemfile bundle install
# Android
- custom:
name: Ensure Android sample app .env files exist
met?: |
([ -f "./platforms/android/samples/MobileBuyIntegration/.env" ] || exit 1)
meet: cd platforms/android && ./scripts/setup_env.sh
- custom:
name: Bootstrap Mint packages
met?: |
set -e
cd platforms/swift
expected_swiftlint="$(sed -n 's#^realm/SwiftLint@##p' Mintfile)"
expected_swiftformat="$(sed -n 's#^nicklockwood/SwiftFormat@##p' Mintfile)"
swiftlint_bin="$(mint which swiftlint)"
swiftformat_bin="$(mint which swiftformat)"
test -n "$expected_swiftlint"
test -n "$expected_swiftformat"
test "$("$swiftlint_bin" version)" = "$expected_swiftlint"
test "$("$swiftformat_bin" --version)" = "$expected_swiftformat"
meet: cd platforms/swift && mint bootstrap
- xcode:
version: "26.2"
runtimes:
ios:
- version: 23C54 # 26.2
architecture_variant: arm64
- custom:
name: Ensure Storefront.xcconfig file
met?: |
([ -f "./platforms/swift/Samples/MobileBuyIntegration/Storefront.xcconfig" ] || exit 1)
meet: cd platforms/swift && ./Scripts/ensure_storefront_config
- custom:
name: Setup entitlements
met?: |
([ -f "./platforms/swift/Samples/MobileBuyIntegration/MobileBuyIntegration/MobileBuyIntegration.entitlements" ] || exit 1;)
meet: cd platforms/swift && ./Scripts/setup_entitlements
- node:
version: v22.14.0
package_manager: pnpm@10.33.1
packages:
- platforms/react-native
- custom:
name: Install NPM dependencies (React Native)
met?: ls -l platforms/react-native | grep node_modules
meet: cd platforms/react-native && pnpm install
- custom:
name: Install gems (React Native sample)
met?: (cd platforms/react-native/sample/ios && bundle check)
meet: cd platforms/react-native/sample/ios && bundle install
- custom:
name: Install pods (React Native sample)
met?: (cd platforms/react-native/sample/ios && bundle exec pod check --ignore-dev-pods)
meet: cd platforms/react-native && pnpm run pod-install
open:
"GitHub": "https://github.com/Shopify/checkout-kit"
"Issues": "https://github.com/Shopify/checkout-kit/issues"
"PRs": "https://github.com/Shopify/checkout-kit/pulls"
check:
android-license-headers: cd platforms/android && ./scripts/check_license_headers.rb
android-detekt: cd platforms/android && ./gradlew detekt
android-lint: cd platforms/android && ./gradlew lintRelease
swift-lint: cd platforms/swift && ./Scripts/lint
react-native-lint-swift: cd platforms/react-native && ./scripts/lint_swift
react-native-lint-module: cd platforms/react-native && pnpm module lint
react-native-lint-sample: cd platforms/react-native && pnpm sample lint
commands:
# Repo-wide
codegen:
desc: "Generate UCP models. Usage: dev codegen <kotlin|swift|typescript>"
syntax: "<kotlin|swift|typescript>"
run: |
case "$1" in
kotlin|swift|typescript|ts) ./protocol/scripts/generate_models.sh --lang "$1" ;;
*) echo "Usage: dev codegen <kotlin|swift|typescript>"; exit 1 ;;
esac
apollo:
subcommands:
download_schema:
desc: "Download GraphQL schema. Usage: dev apollo download_schema <android|swift> [accelerated|mobile-buy|all]"
syntax: "<android|swift> [accelerated|mobile-buy|all]"
run: |
case "$1" in
android) cd platforms/android && ./scripts/apollo_download_schema ;;
swift) shift; cd platforms/swift && ./Scripts/apollo_download_schema "$@" ;;
*) echo "Usage: dev apollo download_schema <android|swift> [accelerated|mobile-buy|all]"; exit 1 ;;
esac
codegen:
desc: "Generate Apollo models. Usage: dev apollo codegen <android|swift> [accelerated|mobile-buy|all]"
syntax: "<android|swift> [accelerated|mobile-buy|all]"
run: |
case "$1" in
android) cd platforms/android && ./scripts/apollo_codegen ;;
swift) shift; cd platforms/swift && ./Scripts/apollo_codegen "$@" ;;
*) echo "Usage: dev apollo codegen <android|swift> [accelerated|mobile-buy|all]"; exit 1 ;;
esac
# Android
android:
desc: "Android Checkout Kit commands"
subcommands:
build:
desc: Build the library
run: cd platforms/android && ./gradlew :lib:build
subcommands:
samples:
desc: Build all sample applications
run: cd platforms/android/samples/MobileBuyIntegration && ./gradlew build
test:
desc: Run all tests with clean build
run: cd platforms/android && ./gradlew clean test --console=plain
subcommands:
specific:
desc: Run specific test class
syntax: <TestClassName> (e.g. CheckoutBridgeTest)
run: cd platforms/android && ./gradlew :lib:testDebugUnitTest --tests "$1"
lint:
desc: Check code style and lint (detekt + Android lint)
aliases: [style]
run: cd platforms/android && ./gradlew detekt lintRelease
fix:
desc: Automatically fix format and lint issues where possible
run: cd platforms/android && ./gradlew detekt --auto-correct
api:
desc: Validate or update the public API baseline (lib/api/lib.api)
run: |
echo "Usage: dev android api {check|dump}"
echo ""
echo " check Verify public API matches the committed baseline"
echo " dump Regenerate the baseline after intentional public API changes"
subcommands:
check:
desc: Verify public API matches the committed baseline
run: cd platforms/android && ./gradlew :lib:apiCheck
dump:
desc: Regenerate the baseline after intentional public API changes
run: cd platforms/android && ./gradlew :lib:apiDump
check:
desc: Run all Android checks (license headers, detekt, android lint)
run: |
set -e
cd platforms/android
./scripts/check_license_headers.rb
./gradlew detekt
./gradlew lintRelease
subcommands:
license-headers:
desc: Check MIT license headers in source files
run: cd platforms/android && ./scripts/check_license_headers.rb
detekt:
desc: Run detekt static analysis
run: cd platforms/android && ./gradlew detekt
android-lint:
desc: Run Android lint
run: cd platforms/android && ./gradlew lintRelease
# Swift
swift:
desc: "Swift Checkout Kit commands"
subcommands:
lint:
desc: Check format and lint issues using SwiftLint and SwiftFormat
aliases: [style]
run: cd platforms/swift && ./Scripts/lint
fix:
desc: Automatically fix format and lint issues where possible
run: cd platforms/swift && ./Scripts/lint fix
build:
desc: Build Swift packages or sample apps
run: |
echo "Usage: dev swift build {packages|samples}"
subcommands:
packages:
desc: Build both ShopifyCheckoutKit and ShopifyAcceleratedCheckouts packages
run: |
cd platforms/swift
./Scripts/xcode_run build ShopifyCheckoutKit
./Scripts/xcode_run build ShopifyAcceleratedCheckouts
samples:
desc: Build all sample applications to verify integration
run: cd platforms/swift && ./Scripts/build_samples
test:
desc: |
`dev swift test` - Run all tests for the ShopifyCheckoutKit-Package.
`dev swift test <test_class_name>` - Run only the specified test class.
syntax: "[test_class_name]"
run: cd platforms/swift && ./Scripts/xcode_run test ShopifyCheckoutKit-Package "$1"
# React Native
react-native:
desc: "React Native Checkout Kit commands"
aliases: [rn]
subcommands:
server:
desc: Start Metro development server
aliases: [s]
run: cd platforms/react-native && pnpm sample start --reset-cache
ios:
desc: Run the iOS sample app in the simulator.
long_desc: |
Builds and runs the iOS sample app on a simulator.
--local
Build against in-repo Swift SDK sources (runs pod install first).
syntax:
optional: --local
run: cd platforms/react-native && pnpm sample ios "$@"
android:
desc: Run the Android sample app in the emulator.
long_desc: |
Builds and runs the Android sample app on an emulator.
--local
Build against in-repo SDK sources (publishes a local Maven snapshot first).
syntax:
optional: --local
run: cd platforms/react-native && pnpm sample android "$@"
pod-install:
desc: Install CocoaPods for the iOS sample.
long_desc: |
Runs pod install for the iOS sample app.
--local
Wire the Podfile against in-repo Swift SDK sources.
syntax:
optional: --local
run: cd platforms/react-native && pnpm run pod-install -- "$@"
clean:
desc: Remove generated directories and stop sccache
run: |
cd platforms/react-native
pnpm module clean
pnpm sample clean
pnpm clean
if command -v sccache >/dev/null 2>&1; then
sccache --stop-server 2>/dev/null || true
fi
echo "Cleaned root, module and sample workspaces"
build:
desc: Build the @shopify/checkout-kit-react-native module
run: cd platforms/react-native && pnpm module build
lint:
desc: Run all React Native lint checks (Swift, module, sample)
aliases: [style]
run: |
set -e
cd platforms/react-native
./scripts/lint_swift
pnpm module lint
pnpm sample lint
subcommands:
swift:
desc: Lint Swift code via SwiftLint
run: cd platforms/react-native && ./scripts/lint_swift
module:
desc: Lint the @shopify/checkout-sheet-kit module
run: cd platforms/react-native && pnpm module lint
sample:
desc: Lint the sample app
run: cd platforms/react-native && pnpm sample lint
format:
desc: Auto-fix Swift lint and format issues
aliases: [fix]
run: cd platforms/react-native && ./scripts/lint_swift fix