Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 26 additions & 11 deletions .github/workflows/rn-test-ios.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ jobs:
defaults:
run:
working-directory: platforms/react-native
env:
MINT_PATH: ${{ github.workspace }}/.mint/lib
MINT_LINK_PATH: ${{ github.workspace }}/.mint/bin
steps:
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3

Expand Down Expand Up @@ -49,22 +52,34 @@ jobs:
bundler-cache: true
working-directory: platforms/react-native/sample

- name: Cache Mint packages
id: mint-cache
uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
with:
path: .mint
key: ${{ runner.os }}-mint-${{ hashFiles('platforms/swift/Mintfile') }}
restore-keys: |
${{ runner.os }}-mint-

- name: Install Mint
run: brew install mint

- name: Bootstrap Mint packages
if: steps.mint-cache.outputs.cache-hit != 'true'
working-directory: platforms/swift
run: mint bootstrap --link

- name: Add Mint to PATH
run: echo "${{ github.workspace }}/.mint/bin" >> "$GITHUB_PATH"

- name: Verify iOS lockfile uses published native SDK
run: scripts/check_published_podfile_lock sample/ios/Podfile.lock
run: scripts/check_published_podfile_lock test/rct-integration-app/Podfile.lock

- name: Cache cocoapods
uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
with:
path: platforms/react-native/sample/ios/Pods
key: ${{ runner.os }}-cocoapods-${{ hashFiles('platforms/react-native/sample/ios/Podfile.lock', 'platforms/react-native/sample/Gemfile.lock', 'platforms/react-native/sample/Gemfile', 'platforms/react-native/package.json', 'platforms/react-native/sample/package.json', 'platforms/react-native/modules/@shopify/checkout-kit-react-native/package.json', 'platforms/react-native/pnpm-lock.yaml') }}

- name: Install cocoapods
working-directory: platforms/react-native/sample
run: |
set -euo pipefail
bundle install
cd ios
bundle exec pod install --deployment --repo-update
path: platforms/react-native/test/rct-integration-app/Pods
key: ${{ runner.os }}-rct-integration-cocoapods-${{ hashFiles('platforms/react-native/test/rct-integration-app/Podfile.lock', 'platforms/react-native/test/rct-integration-app/Podfile', 'platforms/react-native/sample/Gemfile.lock', 'platforms/react-native/sample/Gemfile', 'platforms/react-native/package.json', 'platforms/react-native/test/rct-integration-app/package.json', 'platforms/react-native/modules/@shopify/checkout-kit-react-native/package.json', 'platforms/react-native/pnpm-lock.yaml') }}

- name: Build module
run: pnpm module build
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,14 @@ node_modules/
.swiftpm/
xcuserdata/
platforms/swift/Samples/**/*.xcodeproj/
platforms/react-native/test/rct-integration-app/*.xcodeproj/
platforms/react-native/test/rct-integration-app/*.xcworkspace/

# Sample app generated configuration (Swift)
**/Storefront.xcconfig
**/*.entitlements
platforms/swift/Samples/**/Info.plist
platforms/react-native/test/rct-integration-app/**/Info.plist
# Exception: the React Native sample's entitlements are source code (associated
# domains + in-app payments merchant ID), not secrets — Xcode requires this file
# at build time and CI fails without it.
Expand Down
18 changes: 13 additions & 5 deletions dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -360,22 +360,21 @@ commands:
long_desc: |
Runs unit tests across all three React Native targets:
- JS: Jest tests in `platforms/react-native/modules/@shopify/checkout-kit-react-native/tests/`
- iOS: Swift Package tests at `platforms/react-native/modules/@shopify/checkout-kit-react-native/ios/`
- iOS: Xcode/CocoaPods tests in `platforms/react-native/test/rct-integration-app/`
- Android: Gradle JVM tests for `:shopify_checkout-kit-react-native` (requires a local Maven publish of `:lib`)
run: |
set -e
cd platforms/react-native && pnpm test
cd modules/@shopify/checkout-kit-react-native/ios && swift test
cd ../../../../
pnpm sample test:ios
USE_LOCAL_SDK=1 ./scripts/publish_android_snapshot
cd sample/android && USE_LOCAL_SDK=1 ./gradlew :shopify_checkout-kit-react-native:test --refresh-dependencies
subcommands:
js:
desc: Run JS unit tests via jest
run: cd platforms/react-native && pnpm test
ios:
desc: Run native iOS unit tests (Swift Package at modules/.../ios)
run: cd platforms/react-native/modules/@shopify/checkout-kit-react-native/ios && swift test
desc: Run native iOS unit tests via the RCT integration app
run: cd platforms/react-native && pnpm sample test:ios
android:
desc: Run native Android unit tests for the RN module (publishes/uses local platforms/android SDK)
run: |
Expand Down Expand Up @@ -437,6 +436,15 @@ commands:
else
echo "Skipping CocoaPods cache clean (pod unavailable; run dev up first)"
fi
rm -rf test/rct-integration-app/Pods \
test/rct-integration-app/RCTIntegrationApp.xcodeproj \
test/rct-integration-app/RCTIntegrationApp.xcworkspace \
test/rct-integration-app/RCTIntegrationApp/Info.plist \
test/rct-integration-app/RCTIntegrationAppTests/Info.plist \
test/rct-integration-app/build \
test/rct-integration-app/.xcode.env \
test/rct-integration-app/.xcode.env.local \
test/rct-integration-app/PrivacyInfo.xcprivacy
pnpm module clean
pnpm sample clean
pnpm clean
Expand Down
5 changes: 5 additions & 0 deletions platforms/react-native/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,9 @@ pnpm-debug.log
# Ruby / CocoaPods
/**/Pods/
/vendor/bundle/
test/rct-integration-app/.xcode.env
test/rct-integration-app/PrivacyInfo.xcprivacy


# Temporary files created by Metro to check the health of the file watcher
.metro-health-check*
Expand All @@ -84,6 +87,8 @@ pnpm-debug.log
.build
lib
dist
test/rct-integration-app/*.xcodeproj/
test/rct-integration-app/*.xcworkspace/

# Module
modules/@shopify/checkout-kit-react-native/android/gradle/wrapper/gradle-wrapper.jar
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,6 @@ Pod::Spec.new do |s|
s.source = { :git => "https://github.com/Shopify/checkout-kit.git", :tag => "react-native/#{s.version}" }

s.source_files = "ios/*.{h,m,mm,swift}"
# `ios/Package.swift` is the manifest for the nested SwiftPM test package
# (ProtocolRelay unit tests). It imports `PackageDescription` which only
# exists in the SwiftPM toolchain, so it must not be compiled by
# CocoaPods/Xcode when the RN module is consumed from an iOS app.
s.exclude_files = "ios/Package.swift"

s.dependency "React-Core"

Expand Down

This file was deleted.

12 changes: 12 additions & 0 deletions platforms/react-native/pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions platforms/react-native/pnpm-workspace.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
packages:
- sample
- test/rct-integration-app
- 'modules/**/*'
- '../../protocol/languages/typescript'
Loading
Loading