Skip to content

Commit 44433e5

Browse files
authored
Sample / 0.74.1 → 0.75.5 (#269)
* 0.75.5 * Harden dependencies * Fix lint error in sample * Update CI step * Add Android tools to AndroidManifest.template * Run manifest generation * Add timeouts to steps * Improve cache key for cocoapods - include package.json and lockfile information * Strip surrounding quotes on env value
1 parent 9cb7feb commit 44433e5

File tree

21 files changed

+1541
-991
lines changed

21 files changed

+1541
-991
lines changed
Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,45 @@
11
name: Cocoapods
22
description: Install cocoapods for sample app
33

4+
inputs:
5+
ruby-version:
6+
description: 'Ruby version to use'
7+
required: false
8+
default: '3.1.2'
9+
410
runs:
511
using: composite
612
steps:
13+
- name: Setup Ruby
14+
uses: ruby/setup-ruby@829114fc20da43a41d27359103ec7a63020954d4 # v1.255.0
15+
with:
16+
bundler-cache: true
17+
ruby-version: ${{ inputs.ruby-version }}
18+
working-directory: sample
19+
720
- name: Cache cocoapods
821
id: cache-cocoapods
922
uses: actions/cache@v4
1023
with:
1124
path: |
1225
**/ios/Pods
13-
key: ${{ runner.os }}-cocoapods-${{ hashFiles('sample/ios/Podfile.lock') }}
26+
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') }}
1427
restore-keys: |
28+
${{ runner.os }}-cocoapods-ruby-${{ inputs.ruby-version }}-${{ hashFiles('sample/ios/Podfile.lock', 'sample/package.json', 'yarn.lock') }}
29+
${{ runner.os }}-cocoapods-ruby-${{ inputs.ruby-version }}-${{ hashFiles('sample/ios/Podfile.lock') }}
30+
${{ runner.os }}-cocoapods-ruby-${{ inputs.ruby-version }}-
1531
${{ runner.os }}-cocoapods-
1632
1733
- name: Install cocoapods
18-
if: steps.cocoapods-cache.outputs.cache-hit != 'true'
34+
if: steps.cache-cocoapods.outputs.cache-hit != 'true'
1935
shell: bash
2036
env:
2137
NO_FLIPPER: "1"
2238
run: |
39+
set -euo pipefail
2340
ROOT=$(pwd)
2441
cd sample
2542
bundle install
2643
cd ios
27-
NO_FLIPPER=1 bundle exec pod install
44+
NO_FLIPPER=1 bundle exec pod install --no-repo-update
2845
cd $ROOT

.github/actions/setup-simulator/action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,5 @@ runs:
1212
xcrun simctl list runtimes
1313
xcrun simctl list devicetypes
1414
xcrun simctl delete all
15-
CURRENT_SIMULATOR_UUID=$(xcrun simctl create TestDevice "iPhone 15 Pro")
15+
CURRENT_SIMULATOR_UUID=$(xcrun simctl create TestDevice "iPhone 16 Pro")
1616
echo "CURRENT_SIMULATOR_UUID=$CURRENT_SIMULATOR_UUID" >> $GITHUB_ENV

.github/workflows/ci.yml

Lines changed: 31 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,15 @@ on:
66
pull_request:
77
types: [opened, synchronize]
88

9+
env:
10+
RUBY_VERSION: '3.1.2'
11+
JAVA_VERSION: '22'
12+
913
jobs:
1014
lint-swift:
1115
name: Lint Swift code
1216
runs-on: ubuntu-latest
17+
timeout-minutes: 5
1318
steps:
1419
- uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4.3.0
1520

@@ -21,6 +26,7 @@ jobs:
2126
license:
2227
name: Verify license headers
2328
runs-on: ubuntu-latest
29+
timeout-minutes: 5
2430
steps:
2531
- uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4.3.0
2632

@@ -29,6 +35,7 @@ jobs:
2935
check-packed-files:
3036
name: Check package files
3137
runs-on: ubuntu-latest
38+
timeout-minutes: 5
3239
env:
3340
TERM: xterm
3441
steps:
@@ -45,6 +52,7 @@ jobs:
4552
lint:
4653
name: Lint module + sample
4754
runs-on: ubuntu-latest
55+
timeout-minutes: 10
4856
steps:
4957
- uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4.3.0
5058

@@ -59,6 +67,7 @@ jobs:
5967
test:
6068
name: Run jest tests
6169
runs-on: ubuntu-latest
70+
timeout-minutes: 10
6271
permissions:
6372
contents: read
6473
pull-requests: write
@@ -84,6 +93,7 @@ jobs:
8493
test-android:
8594
name: Run Android Tests
8695
runs-on: ubuntu-latest
96+
timeout-minutes: 20
8797
needs: [lint, test]
8898
steps:
8999
- name: Checkout
@@ -93,28 +103,42 @@ jobs:
93103
uses: ./.github/actions/setup
94104

95105
- name: Install JDK
96-
# if: env.turbo_cache_hit != 1
97106
uses: actions/setup-java@c5195efecf7bdfc987ee8bae7a71cb8b11521c00 # v4.7.1
107+
id: setup-java
98108
with:
99109
distribution: 'zulu'
100-
java-version: '17'
110+
java-version: ${{ env.JAVA_VERSION }}
101111

102112
- name: Run Android tests
113+
timeout-minutes: 20
103114
env:
104115
GRADLE_OPTS: -Xmx4g -XX:MaxMetaspaceSize=768m
116+
JAVA_HOME: ${{ steps.setup-java.outputs.path }}
105117
run: |
106-
echo "STOREFRONT_DOMAIN=\"myshopify.com\"" > sample/.env
118+
echo "JAVA_HOME: $JAVA_HOME"
119+
java -version
120+
javac -version
121+
echo "STOREFRONT_DOMAIN=myshopify.com" > sample/.env
107122
yarn module build
108123
yarn sample test:android --no-daemon
109124
110125
test-ios:
111126
name: Run iOS Tests
112-
runs-on: macos-13-xlarge
127+
runs-on: macos-15-xlarge
128+
timeout-minutes: 20
113129
needs: [lint, lint-swift, test]
114130
steps:
115131
- name: Checkout
116132
uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4.3.0
117133

134+
- name: Switch to Xcode 16.4
135+
run: |
136+
sudo xcode-select --switch /Applications/Xcode_16.4.app
137+
138+
- name: Display Current Xcode Information
139+
run: |
140+
echo "Xcode Path: $(xcode-select -p)"
141+
echo "Xcode Version: $(xcrun xcodebuild -version)"
118142
- name: Setup iOS Simulator
119143
uses: ./.github/actions/setup-simulator
120144

@@ -132,8 +156,11 @@ jobs:
132156
133157
- name: Install cocoapods
134158
uses: ./.github/actions/install-cocoapods
159+
with:
160+
ruby-version: ${{ env.RUBY_VERSION }}
135161

136162
- name: Run Swift tests
163+
timeout-minutes: 15
137164
# If turbo has already cached the build it will return instantly here
138165
run: |
139166
yarn turbo run test:ios --cache-dir=".turbo" --no-daemon

package.json

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,10 @@
2828
"@babel/core": "^7.20.0",
2929
"@babel/preset-env": "^7.20.0",
3030
"@babel/runtime": "^7.27.6",
31-
"@react-native/babel-preset": "0.74.83",
32-
"@react-native/eslint-config": "0.74.83",
33-
"@react-native/metro-config": "0.74.83",
34-
"@react-native/typescript-config": "0.74.83",
31+
"@react-native/babel-preset": "0.75.5",
32+
"@react-native/eslint-config": "0.75.5",
33+
"@react-native/metro-config": "0.75.5",
34+
"@react-native/typescript-config": "0.75.5",
3535
"@tsconfig/react-native": "^3.0.6",
3636
"@types/jest": "^30.0.0",
3737
"@types/react": "^18",
@@ -42,10 +42,10 @@
4242
"eslint-plugin-prettier": "^5.5.1",
4343
"jest": "^30.0.3",
4444
"prettier": "^3.2.5",
45-
"react": "^18.2.0",
46-
"react-native": "0.74.1",
45+
"react": "18.3.1",
46+
"react-native": "0.75.5",
4747
"react-native-dotenv": "^3.4.9",
48-
"react-native-gesture-handler": "^2.15.0",
48+
"react-native-gesture-handler": "2.15.0",
4949
"react-native-gradle-plugin": "^0.71.19",
5050
"react-test-renderer": "18.3.1",
5151
"ts-jest": "^29.1.1",
@@ -78,6 +78,5 @@
7878
"@typescript-eslint/consistent-type-imports": "error",
7979
"no-console": "error"
8080
}
81-
},
82-
"packageManager": "[email protected]"
81+
}
8382
}

sample/Gemfile

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@ source 'https://rubygems.org'
33
# You may use http://rbenv.org/ or https://rvm.io/ to install and use this version
44
ruby ">= 2.6.10"
55

6-
gem 'cocoapods', '1.16.2'
6+
# Exclude problematic versions of cocoapods and activesupport that causes build failures.
7+
gem 'cocoapods', '>= 1.13', '!= 1.15.0', '!= 1.15.1'
8+
gem 'activesupport', '>= 6.1.7.5', '!= 7.1.0'
9+
gem 'xcodeproj', '< 1.26.0'
10+
gem 'concurrent-ruby', '<= 1.3.4'
711
gem 'cocoapods-check', '1.1.0'
8-
gem 'activesupport', '>= 6.1.7.5', '< 7.3.0'

sample/Gemfile.lock

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,10 @@ GEM
2727
benchmark (0.4.1)
2828
bigdecimal (3.2.2)
2929
claide (1.1.0)
30-
cocoapods (1.16.2)
30+
cocoapods (1.15.2)
3131
addressable (~> 2.8)
3232
claide (>= 1.0.2, < 2.0)
33-
cocoapods-core (= 1.16.2)
33+
cocoapods-core (= 1.15.2)
3434
cocoapods-deintegrate (>= 1.0.3, < 2.0)
3535
cocoapods-downloader (>= 2.1, < 3.0)
3636
cocoapods-plugins (>= 1.0.0, < 2.0)
@@ -44,10 +44,10 @@ GEM
4444
molinillo (~> 0.8.0)
4545
nap (~> 1.0)
4646
ruby-macho (>= 2.3.0, < 3.0)
47-
xcodeproj (>= 1.27.0, < 2.0)
47+
xcodeproj (>= 1.23.0, < 2.0)
4848
cocoapods-check (1.1.0)
4949
cocoapods (~> 1.0)
50-
cocoapods-core (1.16.2)
50+
cocoapods-core (1.15.2)
5151
activesupport (>= 5.0, < 8)
5252
addressable (~> 2.8)
5353
algoliasearch (~> 1.0)
@@ -67,7 +67,7 @@ GEM
6767
netrc (~> 0.11)
6868
cocoapods-try (1.2.0)
6969
colored2 (3.1.2)
70-
concurrent-ruby (1.3.5)
70+
concurrent-ruby (1.3.4)
7171
connection_pool (2.5.3)
7272
drb (2.2.3)
7373
escape (0.0.4)
@@ -81,12 +81,12 @@ GEM
8181
mutex_m
8282
i18n (1.14.7)
8383
concurrent-ruby (~> 1.0)
84-
json (2.12.2)
84+
json (2.13.2)
8585
logger (1.7.0)
8686
minitest (5.25.5)
8787
molinillo (0.8.0)
8888
mutex_m (0.3.0)
89-
nanaimo (0.4.0)
89+
nanaimo (0.3.0)
9090
nap (1.1.0)
9191
netrc (0.11.0)
9292
nkf (0.2.0)
@@ -98,24 +98,26 @@ GEM
9898
ethon (>= 0.9.0)
9999
tzinfo (2.0.6)
100100
concurrent-ruby (~> 1.0)
101-
xcodeproj (1.27.0)
101+
xcodeproj (1.25.1)
102102
CFPropertyList (>= 2.3.3, < 4.0)
103103
atomos (~> 0.1.3)
104104
claide (>= 1.0.2, < 2.0)
105105
colored2 (~> 3.1)
106-
nanaimo (~> 0.4.0)
106+
nanaimo (~> 0.3.0)
107107
rexml (>= 3.3.6, < 4.0)
108108

109109
PLATFORMS
110110
ruby
111111

112112
DEPENDENCIES
113-
activesupport (>= 6.1.7.5, < 7.3.0)
114-
cocoapods (= 1.16.2)
113+
activesupport (>= 6.1.7.5, != 7.1.0)
114+
cocoapods (>= 1.13, != 1.15.1, != 1.15.0)
115115
cocoapods-check (= 1.1.0)
116+
concurrent-ruby (<= 1.3.4)
117+
xcodeproj (< 1.26.0)
116118

117119
RUBY VERSION
118-
ruby 3.1.2p20
120+
ruby 3.3.6p108
119121

120122
BUNDLED WITH
121123
2.5.23

sample/android/app/build.gradle

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -47,10 +47,13 @@ react {
4747

4848
/* Hermes Commands */
4949
// The hermes compiler command to run. By default it is 'hermesc'
50-
hermesCommand = "../node_modules/react-native/sdks/hermesc/%OS-BIN%/hermesc"
50+
hermesCommand = "../node_modules/react-native/sdks/hermesc/%OS-BIN%/hermesc"
5151
//
5252
// The list of flags to pass to the Hermes compiler. By default is "-O", "-output-source-map"
53-
hermesFlags = ["-O", "-output-source-map"]
53+
hermesFlags = ["-O", "-output-source-map"]
54+
55+
/* Autolinking */
56+
autolinkLibrariesWithApp()
5457
}
5558

5659
/**
@@ -143,12 +146,17 @@ project.ext.vectoricons = [
143146

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

146-
apply from: file("../../../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesAppBuildGradle(project)
147-
148149
apply from: project(':react-native-config').projectDir.getPath() + "/dotenv.gradle"
149150

151+
def stripSurroundingQuotes(String value) {
152+
if (value == null) {
153+
return null
154+
}
155+
return value.trim()?.replaceAll(/^['"]|['"]$/, '')
156+
}
157+
150158
def properties = loadProperties()
151-
def storefrontDomain = properties.getProperty("STOREFRONT_DOMAIN")
159+
def storefrontDomain = stripSurroundingQuotes(properties.getProperty("STOREFRONT_DOMAIN"))
152160

153161
if (!storefrontDomain) {
154162
println("**** Please add a .env file with STOREFRONT_DOMAIN set *****")

sample/android/app/src/main/AndroidManifest.template.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
1+
<manifest xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools">
22

33
<uses-permission android:name="android.permission.INTERNET" />
44
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
@@ -33,7 +33,7 @@
3333
<category android:name="android.intent.category.BROWSABLE" />
3434

3535
<!-- Note: the host here will be replaced on application start -->
36-
<data android:scheme="https" android:host={{STOREFRONT_DOMAIN}} />
36+
<data android:scheme="https" android:host="{{STOREFRONT_DOMAIN}}" />
3737
</intent-filter>
3838
</activity>
3939
</application>

sample/android/build.gradle

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,19 @@
11
// Top-level build file where you can add configuration options common to all sub-projects/modules.
22
buildscript {
33
ext {
4-
buildToolsVersion = "34.0.0"
4+
buildToolsVersion = "35.0.0"
55
minSdkVersion = 23
6-
compileSdkVersion = 34
6+
compileSdkVersion = 35
77
targetSdkVersion = 34
88
ndkVersion = "26.1.10909125"
9-
kotlinVersion = "1.9.22"
10-
9+
kotlinVersion = "1.9.25"
1110
}
1211
repositories {
1312
google()
1413
mavenCentral()
1514
}
1615
dependencies {
17-
classpath("com.android.tools.build:gradle")
16+
classpath("com.android.tools.build:gradle:8.6.0")
1817
classpath("com.facebook.react:react-native-gradle-plugin")
1918
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin")
2019
}

sample/android/gradle.properties

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,6 @@ org.gradle.jvmargs=-Xmx2048m -XX:MaxMetaspaceSize=512m
2323
# Android operating system, and which are packaged with your app's APK
2424
# https://developer.android.com/topic/libraries/support-library/androidx-rn
2525
android.useAndroidX=true
26-
# Automatically convert third-party libraries to use AndroidX
27-
android.enableJetifier=true
2826

2927
# Use this property to specify which architecture you want to build.
3028
# You can also override it from the CLI using

0 commit comments

Comments
 (0)