Skip to content
Merged
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
23 changes: 20 additions & 3 deletions .github/actions/install-cocoapods/action.yml
Original file line number Diff line number Diff line change
@@ -1,28 +1,45 @@
name: Cocoapods
description: Install cocoapods for sample app

inputs:
ruby-version:
description: 'Ruby version to use'
required: false
default: '3.1.2'

runs:
using: composite
steps:
- name: Setup Ruby
uses: ruby/setup-ruby@829114fc20da43a41d27359103ec7a63020954d4 # v1.255.0
with:
bundler-cache: true
ruby-version: ${{ inputs.ruby-version }}
working-directory: sample

- name: Cache cocoapods
id: cache-cocoapods
uses: actions/cache@v4
with:
path: |
**/ios/Pods
key: ${{ runner.os }}-cocoapods-${{ hashFiles('sample/ios/Podfile.lock') }}
key: ${{ runner.os }}-cocoapods-ruby-${{ inputs.ruby-version }}-${{ hashFiles('sample/ios/Podfile.lock', 'sample/Gemfile.lock', 'package.json', 'sample/package.json', 'modules/@shopify/checkout-sheet-kit/package.json', 'yarn.lock') }}
restore-keys: |
${{ runner.os }}-cocoapods-ruby-${{ inputs.ruby-version }}-${{ hashFiles('sample/ios/Podfile.lock', 'sample/package.json', 'yarn.lock') }}
${{ runner.os }}-cocoapods-ruby-${{ inputs.ruby-version }}-${{ hashFiles('sample/ios/Podfile.lock') }}
${{ runner.os }}-cocoapods-ruby-${{ inputs.ruby-version }}-
${{ runner.os }}-cocoapods-

- name: Install cocoapods
if: steps.cocoapods-cache.outputs.cache-hit != 'true'
if: steps.cache-cocoapods.outputs.cache-hit != 'true'
shell: bash
env:
NO_FLIPPER: "1"
run: |
set -euo pipefail
ROOT=$(pwd)
cd sample
bundle install
cd ios
NO_FLIPPER=1 bundle exec pod install
NO_FLIPPER=1 bundle exec pod install --no-repo-update
cd $ROOT
2 changes: 1 addition & 1 deletion .github/actions/setup-simulator/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,5 @@ runs:
xcrun simctl list runtimes
xcrun simctl list devicetypes
xcrun simctl delete all
CURRENT_SIMULATOR_UUID=$(xcrun simctl create TestDevice "iPhone 15 Pro")
CURRENT_SIMULATOR_UUID=$(xcrun simctl create TestDevice "iPhone 16 Pro")
echo "CURRENT_SIMULATOR_UUID=$CURRENT_SIMULATOR_UUID" >> $GITHUB_ENV
35 changes: 31 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,15 @@ on:
pull_request:
types: [opened, synchronize]

env:
RUBY_VERSION: '3.1.2'
JAVA_VERSION: '22'

jobs:
lint-swift:
name: Lint Swift code
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4.3.0

Expand All @@ -21,6 +26,7 @@ jobs:
license:
name: Verify license headers
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4.3.0

Expand All @@ -29,6 +35,7 @@ jobs:
check-packed-files:
name: Check package files
runs-on: ubuntu-latest
timeout-minutes: 5
env:
TERM: xterm
steps:
Expand All @@ -45,6 +52,7 @@ jobs:
lint:
name: Lint module + sample
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4.3.0

Expand All @@ -59,6 +67,7 @@ jobs:
test:
name: Run jest tests
runs-on: ubuntu-latest
timeout-minutes: 10
permissions:
contents: read
pull-requests: write
Expand All @@ -84,6 +93,7 @@ jobs:
test-android:
name: Run Android Tests
runs-on: ubuntu-latest
timeout-minutes: 20
needs: [lint, test]
steps:
- name: Checkout
Expand All @@ -93,28 +103,42 @@ jobs:
uses: ./.github/actions/setup

- name: Install JDK
# if: env.turbo_cache_hit != 1
uses: actions/setup-java@c5195efecf7bdfc987ee8bae7a71cb8b11521c00 # v4.7.1
id: setup-java
with:
distribution: 'zulu'
java-version: '17'
java-version: ${{ env.JAVA_VERSION }}

- name: Run Android tests
timeout-minutes: 20
env:
GRADLE_OPTS: -Xmx4g -XX:MaxMetaspaceSize=768m
JAVA_HOME: ${{ steps.setup-java.outputs.path }}
run: |
echo "STOREFRONT_DOMAIN=\"myshopify.com\"" > sample/.env
echo "JAVA_HOME: $JAVA_HOME"
java -version
javac -version
echo "STOREFRONT_DOMAIN=myshopify.com" > sample/.env
yarn module build
yarn sample test:android --no-daemon

test-ios:
name: Run iOS Tests
runs-on: macos-13-xlarge
runs-on: macos-15-xlarge
timeout-minutes: 20
needs: [lint, lint-swift, test]
steps:
- name: Checkout
uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4.3.0

- name: Switch to Xcode 16.4
run: |
sudo xcode-select --switch /Applications/Xcode_16.4.app

- name: Display Current Xcode Information
run: |
echo "Xcode Path: $(xcode-select -p)"
echo "Xcode Version: $(xcrun xcodebuild -version)"
- name: Setup iOS Simulator
uses: ./.github/actions/setup-simulator

Expand All @@ -132,8 +156,11 @@ jobs:

- name: Install cocoapods
uses: ./.github/actions/install-cocoapods
with:
ruby-version: ${{ env.RUBY_VERSION }}

- name: Run Swift tests
timeout-minutes: 15
# If turbo has already cached the build it will return instantly here
run: |
yarn turbo run test:ios --cache-dir=".turbo" --no-daemon
17 changes: 8 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,10 @@
"@babel/core": "^7.20.0",
"@babel/preset-env": "^7.20.0",
"@babel/runtime": "^7.27.6",
"@react-native/babel-preset": "0.74.83",
"@react-native/eslint-config": "0.74.83",
"@react-native/metro-config": "0.74.83",
"@react-native/typescript-config": "0.74.83",
"@react-native/babel-preset": "0.75.5",
"@react-native/eslint-config": "0.75.5",
"@react-native/metro-config": "0.75.5",
"@react-native/typescript-config": "0.75.5",
"@tsconfig/react-native": "^3.0.6",
"@types/jest": "^30.0.0",
"@types/react": "^18",
Expand All @@ -42,10 +42,10 @@
"eslint-plugin-prettier": "^5.5.1",
"jest": "^30.0.3",
"prettier": "^3.2.5",
"react": "^18.2.0",
"react-native": "0.74.1",
"react": "18.3.1",
"react-native": "0.75.5",
"react-native-dotenv": "^3.4.9",
"react-native-gesture-handler": "^2.15.0",
"react-native-gesture-handler": "2.15.0",
"react-native-gradle-plugin": "^0.71.19",
"react-test-renderer": "18.3.1",
"ts-jest": "^29.1.1",
Expand Down Expand Up @@ -78,6 +78,5 @@
"@typescript-eslint/consistent-type-imports": "error",
"no-console": "error"
}
},
"packageManager": "yarn@4.4.1"
}
}
7 changes: 5 additions & 2 deletions sample/Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ source 'https://rubygems.org'
# You may use http://rbenv.org/ or https://rvm.io/ to install and use this version
ruby ">= 2.6.10"

gem 'cocoapods', '1.16.2'
# Exclude problematic versions of cocoapods and activesupport that causes build failures.
gem 'cocoapods', '>= 1.13', '!= 1.15.0', '!= 1.15.1'
gem 'activesupport', '>= 6.1.7.5', '!= 7.1.0'
gem 'xcodeproj', '< 1.26.0'
gem 'concurrent-ruby', '<= 1.3.4'
gem 'cocoapods-check', '1.1.0'
gem 'activesupport', '>= 6.1.7.5', '< 7.3.0'
26 changes: 14 additions & 12 deletions sample/Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@ GEM
benchmark (0.4.1)
bigdecimal (3.2.2)
claide (1.1.0)
cocoapods (1.16.2)
cocoapods (1.15.2)
addressable (~> 2.8)
claide (>= 1.0.2, < 2.0)
cocoapods-core (= 1.16.2)
cocoapods-core (= 1.15.2)
cocoapods-deintegrate (>= 1.0.3, < 2.0)
cocoapods-downloader (>= 2.1, < 3.0)
cocoapods-plugins (>= 1.0.0, < 2.0)
Expand All @@ -44,10 +44,10 @@ GEM
molinillo (~> 0.8.0)
nap (~> 1.0)
ruby-macho (>= 2.3.0, < 3.0)
xcodeproj (>= 1.27.0, < 2.0)
xcodeproj (>= 1.23.0, < 2.0)
cocoapods-check (1.1.0)
cocoapods (~> 1.0)
cocoapods-core (1.16.2)
cocoapods-core (1.15.2)
activesupport (>= 5.0, < 8)
addressable (~> 2.8)
algoliasearch (~> 1.0)
Expand All @@ -67,7 +67,7 @@ GEM
netrc (~> 0.11)
cocoapods-try (1.2.0)
colored2 (3.1.2)
concurrent-ruby (1.3.5)
concurrent-ruby (1.3.4)
connection_pool (2.5.3)
drb (2.2.3)
escape (0.0.4)
Expand All @@ -81,12 +81,12 @@ GEM
mutex_m
i18n (1.14.7)
concurrent-ruby (~> 1.0)
json (2.12.2)
json (2.13.2)
logger (1.7.0)
minitest (5.25.5)
molinillo (0.8.0)
mutex_m (0.3.0)
nanaimo (0.4.0)
nanaimo (0.3.0)
nap (1.1.0)
netrc (0.11.0)
nkf (0.2.0)
Expand All @@ -98,24 +98,26 @@ GEM
ethon (>= 0.9.0)
tzinfo (2.0.6)
concurrent-ruby (~> 1.0)
xcodeproj (1.27.0)
xcodeproj (1.25.1)
CFPropertyList (>= 2.3.3, < 4.0)
atomos (~> 0.1.3)
claide (>= 1.0.2, < 2.0)
colored2 (~> 3.1)
nanaimo (~> 0.4.0)
nanaimo (~> 0.3.0)
rexml (>= 3.3.6, < 4.0)

PLATFORMS
ruby

DEPENDENCIES
activesupport (>= 6.1.7.5, < 7.3.0)
cocoapods (= 1.16.2)
activesupport (>= 6.1.7.5, != 7.1.0)
cocoapods (>= 1.13, != 1.15.1, != 1.15.0)
cocoapods-check (= 1.1.0)
concurrent-ruby (<= 1.3.4)
xcodeproj (< 1.26.0)

RUBY VERSION
ruby 3.1.2p20
ruby 3.3.6p108

BUNDLED WITH
2.5.23
18 changes: 13 additions & 5 deletions sample/android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,13 @@ react {

/* Hermes Commands */
// The hermes compiler command to run. By default it is 'hermesc'
hermesCommand = "../node_modules/react-native/sdks/hermesc/%OS-BIN%/hermesc"
hermesCommand = "../node_modules/react-native/sdks/hermesc/%OS-BIN%/hermesc"
//
// The list of flags to pass to the Hermes compiler. By default is "-O", "-output-source-map"
hermesFlags = ["-O", "-output-source-map"]
hermesFlags = ["-O", "-output-source-map"]

/* Autolinking */
autolinkLibrariesWithApp()
}

/**
Expand Down Expand Up @@ -143,12 +146,17 @@ project.ext.vectoricons = [

apply from: file("../../node_modules/react-native-vector-icons/fonts.gradle")

apply from: file("../../../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesAppBuildGradle(project)

apply from: project(':react-native-config').projectDir.getPath() + "/dotenv.gradle"

def stripSurroundingQuotes(String value) {
if (value == null) {
return null
}
return value.trim()?.replaceAll(/^['"]|['"]$/, '')
}

def properties = loadProperties()
def storefrontDomain = properties.getProperty("STOREFRONT_DOMAIN")
def storefrontDomain = stripSurroundingQuotes(properties.getProperty("STOREFRONT_DOMAIN"))

if (!storefrontDomain) {
println("**** Please add a .env file with STOREFRONT_DOMAIN set *****")
Expand Down
4 changes: 2 additions & 2 deletions sample/android/app/src/main/AndroidManifest.template.xml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
<manifest xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools">

<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
Expand Down Expand Up @@ -33,7 +33,7 @@
<category android:name="android.intent.category.BROWSABLE" />

<!-- Note: the host here will be replaced on application start -->
<data android:scheme="https" android:host={{STOREFRONT_DOMAIN}} />
Comment thread
markmur marked this conversation as resolved.
<data android:scheme="https" android:host="{{STOREFRONT_DOMAIN}}" />
Comment thread
markmur marked this conversation as resolved.
</intent-filter>
</activity>
</application>
Expand Down
9 changes: 4 additions & 5 deletions sample/android/build.gradle
Original file line number Diff line number Diff line change
@@ -1,20 +1,19 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
ext {
buildToolsVersion = "34.0.0"
buildToolsVersion = "35.0.0"
minSdkVersion = 23
compileSdkVersion = 34
compileSdkVersion = 35
targetSdkVersion = 34
ndkVersion = "26.1.10909125"
kotlinVersion = "1.9.22"

kotlinVersion = "1.9.25"
}
repositories {
google()
mavenCentral()
}
dependencies {
classpath("com.android.tools.build:gradle")
classpath("com.android.tools.build:gradle:8.6.0")
classpath("com.facebook.react:react-native-gradle-plugin")
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin")
}
Expand Down
2 changes: 0 additions & 2 deletions sample/android/gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@ org.gradle.jvmargs=-Xmx2048m -XX:MaxMetaspaceSize=512m
# Android operating system, and which are packaged with your app's APK
# https://developer.android.com/topic/libraries/support-library/androidx-rn
android.useAndroidX=true
# Automatically convert third-party libraries to use AndroidX
android.enableJetifier=true

# Use this property to specify which architecture you want to build.
# You can also override it from the CLI using
Expand Down
2 changes: 1 addition & 1 deletion sample/android/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.6-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.8-all.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
Expand Down
Loading
Loading