Skip to content

Commit d8c0710

Browse files
authored
Add CI build step for iOS (#22)
1 parent c03af83 commit d8c0710

File tree

13 files changed

+148
-232
lines changed

13 files changed

+148
-232
lines changed
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: Cocoapods
2+
description: Install cocoapods for sample app
3+
4+
runs:
5+
using: composite
6+
steps:
7+
- name: Cache cocoapods
8+
id: cache-cocoapods
9+
uses: actions/cache@v3
10+
with:
11+
path: |
12+
**/ios/Pods
13+
key: ${{ runner.os }}-cocoapods-${{ hashFiles('sample/ios/Podfile.lock') }}
14+
restore-keys: |
15+
${{ runner.os }}-cocoapods-
16+
17+
- name: Install cocoapods
18+
if: steps.cocoapods-cache.outputs.cache-hit != 'true'
19+
shell: bash
20+
env:
21+
NO_FLIPPER: "1"
22+
run: |
23+
yarn pod-install sample/ios
24+
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
name: Setup
2+
description: Setup Node.js and install dependencies
3+
4+
runs:
5+
using: composite
6+
steps:
7+
- name: Cache turbo build setup
8+
uses: actions/cache@v3
9+
with:
10+
path: .turbo
11+
key: turbo-${{ github.sha }}
12+
restore-keys: |
13+
turbo-

.github/workflows/ci.yml

Lines changed: 45 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -7,19 +7,6 @@ on:
77
types: [opened, synchronize]
88

99
jobs:
10-
lint:
11-
name: Lint workspaces
12-
runs-on: shopify-ubuntu-latest
13-
env:
14-
TURBO_CACHE_DIR: .turbo/lint
15-
steps:
16-
- uses: actions/checkout@v3
17-
18-
- name: Setup
19-
uses: ./.github/actions/setup
20-
21-
- run: yarn turbo run lint --cache-dir="${{ env.TURBO_CACHE_DIR }}"
22-
2310
lint-swift:
2411
name: Lint Swift code
2512
runs-on: shopify-ubuntu-latest
@@ -39,19 +26,6 @@ jobs:
3926

4027
- run: ./scripts/copy_license && git diff --name-only --exit-code
4128

42-
build-native-module:
43-
name: Build Native Module
44-
runs-on: shopify-ubuntu-latest
45-
env:
46-
TURBO_CACHE_DIR: .turbo/react-native-shopify-checkout-kit
47-
steps:
48-
- uses: actions/checkout@v3
49-
50-
- name: Setup
51-
uses: ./.github/actions/setup
52-
53-
- run: yarn turbo run build --cache-dir="${{ env.TURBO_CACHE_DIR }}"
54-
5529
check-packed-files:
5630
name: Check package files
5731
runs-on: shopify-ubuntu-latest
@@ -63,38 +37,26 @@ jobs:
6337
- name: Setup
6438
uses: ./.github/actions/setup
6539

66-
- name: Install jq
67-
run: sudo apt-get install -y jq
68-
6940
- run: ./scripts/compare_snapshot
7041

7142
build-android:
7243
name: Build Android Sample App
7344
runs-on: shopify-ubuntu-latest
74-
env:
75-
TURBO_CACHE_DIR: .turbo/android
7645
steps:
7746
- name: Checkout
7847
uses: actions/checkout@v3
7948

8049
- name: Setup
8150
uses: ./.github/actions/setup
8251

83-
- name: Cache turborepo for Android
84-
uses: actions/cache@v3
85-
with:
86-
path: ${{ env.TURBO_CACHE_DIR }}
87-
key: ${{ runner.os }}-turborepo-android-${{ hashFiles('**/yarn.lock') }}
88-
restore-keys: |
89-
${{ runner.os }}-turborepo-android-
52+
- name: Check turbo cache
53+
uses: ./.github/actions/use-turbo-cache
9054

91-
- name: Check turborepo cache for Android
55+
- name: Check build cache
9256
run: |
93-
TURBO_CACHE_STATUS=$(node -p "($(yarn turbo run build:android --cache-dir="${{ env.TURBO_CACHE_DIR }}" --dry=json)).tasks.find(t => t.task === 'build:android').cache.status")
94-
95-
if [[ $TURBO_CACHE_STATUS == "HIT" ]]; then
96-
echo "turbo_cache_hit=1" >> $GITHUB_ENV
97-
fi
57+
CACHE_STATUS=$(./scripts/check_cache sample build:android)
58+
echo "[sample] build:android - $CACHE_STATUS"
59+
echo "turbo_cache_hit=$CACHE_STATUS" >> $GITHUB_ENV
9860
9961
- name: Install JDK
10062
if: env.turbo_cache_hit != 1
@@ -110,27 +72,50 @@ jobs:
11072
path: |
11173
~/.gradle/wrapper
11274
~/.gradle/caches
75+
sample/android/.gradle/wrapper
76+
sample/android/.gradle/caches
11377
key: ${{ runner.os }}-gradle-${{ hashFiles('sample/android/gradle/wrapper/gradle-wrapper.properties') }}
11478
restore-keys: |
11579
${{ runner.os }}-gradle-
11680
117-
- name: Cache Android SDK
118-
uses: actions/cache@v3
119-
with:
120-
path: /usr/local/android-sdk
121-
key: ${{ runner.os }}-android-sdk
122-
restore-keys: |
123-
${{ runner.os }}-android-sdk
81+
- name: Build sample for Android
82+
# If turbo has already cached the build it will return instantly here
83+
run: |
84+
yarn turbo run build:android --cache-dir=".turbo"
12485
125-
- name: Cache build output
126-
uses: actions/cache@v3
127-
with:
128-
path: ./sample/android/app/build
129-
key: ${{ runner.os }}-build-${{ hashFiles('**/*.java', '**/*.xml', '**/*.gradle', '**/gradle.properties') }}
86+
build-ios:
87+
name: Build iOS Sample App
88+
runs-on: macos-latest
89+
steps:
90+
- name: Checkout
91+
uses: actions/checkout@v3
13092

131-
restore-keys: |
132-
${{ runner.os }}-build-
93+
- name: Setup iOS Simulator
94+
run: |
95+
xcode-select -p
96+
xcrun xcodebuild -version
97+
xcrun simctl list runtimes
98+
xcrun simctl list devicetypes
99+
xcrun simctl delete all
100+
CURRENT_SIMULATOR_UUID=$(xcrun simctl create TestDevice "iPhone 14 Pro Max")
101+
echo "CURRENT_SIMULATOR_UUID=$CURRENT_SIMULATOR_UUID" >> $GITHUB_ENV
102+
103+
- name: Setup
104+
uses: ./.github/actions/setup
105+
106+
- name: Check turbo cache
107+
uses: ./.github/actions/use-turbo-cache
108+
109+
- name: Check build cache
110+
run: |
111+
CACHE_STATUS=$(./scripts/check_cache sample build:ios)
112+
echo "[sample] build:ios - $CACHE_STATUS"
113+
echo "turbo_cache_hit=$CACHE_STATUS" >> $GITHUB_ENV
114+
115+
- name: Install cocoapods
116+
uses: ./.github/actions/install-cocoapods
133117

134-
- name: Build example for Android
118+
- name: Build sample for iOS
119+
# If turbo has already cached the build it will return instantly here
135120
run: |
136-
yarn turbo run build:android --cache-dir="${{ env.TURBO_CACHE_DIR }}"
121+
yarn turbo run build:ios --cache-dir=".turbo"

.yarnrc.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,4 @@ nmHoistingLimits: workspaces
22

33
nodeLinker: node-modules
44

5-
plugins:
6-
- path: scripts/pod-install.cjs
7-
85
yarnPath: .yarn/releases/yarn-4.0.2.cjs

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
"clean": "watchman watch-del .",
1919
"sample": "yarn workspace sample",
2020
"module": "yarn workspace react-native-shopify-checkout-kit",
21+
"pod-install": "NO_FLIPPER=1 pod-install",
2122
"snapshot": "./scripts/create_snapshot",
2223
"turbo": "turbo"
2324
},

sample/ios/Podfile.lock

Lines changed: 0 additions & 106 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
PODS:
22
- boost (1.76.0)
3-
- CocoaAsyncSocket (7.6.5)
43
- DoubleConversion (1.1.6)
54
- FBLazyVector (0.72.6)
65
- FBReactNativeSpec (0.72.6):
@@ -10,71 +9,12 @@ PODS:
109
- React-Core (= 0.72.6)
1110
- React-jsi (= 0.72.6)
1211
- ReactCommon/turbomodule/core (= 0.72.6)
13-
- Flipper (0.182.0):
14-
- Flipper-Folly (~> 2.6)
15-
- Flipper-Boost-iOSX (1.76.0.1.11)
16-
- Flipper-DoubleConversion (3.2.0.1)
17-
- Flipper-Fmt (7.1.7)
18-
- Flipper-Folly (2.6.10):
19-
- Flipper-Boost-iOSX
20-
- Flipper-DoubleConversion
21-
- Flipper-Fmt (= 7.1.7)
22-
- Flipper-Glog
23-
- libevent (~> 2.1.12)
24-
- OpenSSL-Universal (= 1.1.1100)
25-
- Flipper-Glog (0.5.0.5)
26-
- Flipper-PeerTalk (0.0.4)
27-
- FlipperKit (0.182.0):
28-
- FlipperKit/Core (= 0.182.0)
29-
- FlipperKit/Core (0.182.0):
30-
- Flipper (~> 0.182.0)
31-
- FlipperKit/CppBridge
32-
- FlipperKit/FBCxxFollyDynamicConvert
33-
- FlipperKit/FBDefines
34-
- FlipperKit/FKPortForwarding
35-
- SocketRocket (~> 0.6.0)
36-
- FlipperKit/CppBridge (0.182.0):
37-
- Flipper (~> 0.182.0)
38-
- FlipperKit/FBCxxFollyDynamicConvert (0.182.0):
39-
- Flipper-Folly (~> 2.6)
40-
- FlipperKit/FBDefines (0.182.0)
41-
- FlipperKit/FKPortForwarding (0.182.0):
42-
- CocoaAsyncSocket (~> 7.6)
43-
- Flipper-PeerTalk (~> 0.0.4)
44-
- FlipperKit/FlipperKitHighlightOverlay (0.182.0)
45-
- FlipperKit/FlipperKitLayoutHelpers (0.182.0):
46-
- FlipperKit/Core
47-
- FlipperKit/FlipperKitHighlightOverlay
48-
- FlipperKit/FlipperKitLayoutTextSearchable
49-
- FlipperKit/FlipperKitLayoutIOSDescriptors (0.182.0):
50-
- FlipperKit/Core
51-
- FlipperKit/FlipperKitHighlightOverlay
52-
- FlipperKit/FlipperKitLayoutHelpers
53-
- YogaKit (~> 1.18)
54-
- FlipperKit/FlipperKitLayoutPlugin (0.182.0):
55-
- FlipperKit/Core
56-
- FlipperKit/FlipperKitHighlightOverlay
57-
- FlipperKit/FlipperKitLayoutHelpers
58-
- FlipperKit/FlipperKitLayoutIOSDescriptors
59-
- FlipperKit/FlipperKitLayoutTextSearchable
60-
- YogaKit (~> 1.18)
61-
- FlipperKit/FlipperKitLayoutTextSearchable (0.182.0)
62-
- FlipperKit/FlipperKitNetworkPlugin (0.182.0):
63-
- FlipperKit/Core
64-
- FlipperKit/FlipperKitReactPlugin (0.182.0):
65-
- FlipperKit/Core
66-
- FlipperKit/FlipperKitUserDefaultsPlugin (0.182.0):
67-
- FlipperKit/Core
68-
- FlipperKit/SKIOSNetworkPlugin (0.182.0):
69-
- FlipperKit/Core
70-
- FlipperKit/FlipperKitNetworkPlugin
7112
- fmt (6.2.1)
7213
- glog (0.3.5)
7314
- hermes-engine (0.72.6):
7415
- hermes-engine/Pre-built (= 0.72.6)
7516
- hermes-engine/Pre-built (0.72.6)
7617
- libevent (2.1.12)
77-
- OpenSSL-Universal (1.1.1100)
7818
- RCT-Folly (2021.07.22.00):
7919
- boost
8020
- DoubleConversion
@@ -534,46 +474,22 @@ PODS:
534474
- SocketRocket (0.6.1)
535475
- SwiftLint (0.54.0)
536476
- Yoga (1.14.0)
537-
- YogaKit (1.18.1):
538-
- Yoga (~> 1.14)
539477

540478
DEPENDENCIES:
541479
- boost (from `../node_modules/react-native/third-party-podspecs/boost.podspec`)
542480
- DoubleConversion (from `../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec`)
543481
- FBLazyVector (from `../node_modules/react-native/Libraries/FBLazyVector`)
544482
- FBReactNativeSpec (from `../node_modules/react-native/React/FBReactNativeSpec`)
545-
- Flipper (= 0.182.0)
546-
- Flipper-Boost-iOSX (= 1.76.0.1.11)
547-
- Flipper-DoubleConversion (= 3.2.0.1)
548-
- Flipper-Fmt (= 7.1.7)
549-
- Flipper-Folly (= 2.6.10)
550-
- Flipper-Glog (= 0.5.0.5)
551-
- Flipper-PeerTalk (= 0.0.4)
552-
- FlipperKit (= 0.182.0)
553-
- FlipperKit/Core (= 0.182.0)
554-
- FlipperKit/CppBridge (= 0.182.0)
555-
- FlipperKit/FBCxxFollyDynamicConvert (= 0.182.0)
556-
- FlipperKit/FBDefines (= 0.182.0)
557-
- FlipperKit/FKPortForwarding (= 0.182.0)
558-
- FlipperKit/FlipperKitHighlightOverlay (= 0.182.0)
559-
- FlipperKit/FlipperKitLayoutPlugin (= 0.182.0)
560-
- FlipperKit/FlipperKitLayoutTextSearchable (= 0.182.0)
561-
- FlipperKit/FlipperKitNetworkPlugin (= 0.182.0)
562-
- FlipperKit/FlipperKitReactPlugin (= 0.182.0)
563-
- FlipperKit/FlipperKitUserDefaultsPlugin (= 0.182.0)
564-
- FlipperKit/SKIOSNetworkPlugin (= 0.182.0)
565483
- glog (from `../node_modules/react-native/third-party-podspecs/glog.podspec`)
566484
- hermes-engine (from `../node_modules/react-native/sdks/hermes-engine/hermes-engine.podspec`)
567485
- libevent (~> 2.1.12)
568-
- OpenSSL-Universal (= 1.1.1100)
569486
- RCT-Folly (from `../node_modules/react-native/third-party-podspecs/RCT-Folly.podspec`)
570487
- RCTRequired (from `../node_modules/react-native/Libraries/RCTRequired`)
571488
- RCTTypeSafety (from `../node_modules/react-native/Libraries/TypeSafety`)
572489
- React (from `../node_modules/react-native/`)
573490
- React-callinvoker (from `../node_modules/react-native/ReactCommon/callinvoker`)
574491
- React-Codegen (from `build/generated/ios`)
575492
- React-Core (from `../node_modules/react-native/`)
576-
- React-Core/DevSupport (from `../node_modules/react-native/`)
577493
- React-Core/RCTWebSocket (from `../node_modules/react-native/`)
578494
- React-CoreModules (from `../node_modules/react-native/React/CoreModules`)
579495
- React-cxxreact (from `../node_modules/react-native/ReactCommon/cxxreact`)
@@ -612,22 +528,11 @@ DEPENDENCIES:
612528

613529
SPEC REPOS:
614530
trunk:
615-
- CocoaAsyncSocket
616-
- Flipper
617-
- Flipper-Boost-iOSX
618-
- Flipper-DoubleConversion
619-
- Flipper-Fmt
620-
- Flipper-Folly
621-
- Flipper-Glog
622-
- Flipper-PeerTalk
623-
- FlipperKit
624531
- fmt
625532
- libevent
626-
- OpenSSL-Universal
627533
- ShopifyCheckoutKit
628534
- SocketRocket
629535
- SwiftLint
630-
- YogaKit
631536

632537
EXTERNAL SOURCES:
633538
boost:
@@ -726,23 +631,13 @@ EXTERNAL SOURCES:
726631

727632
SPEC CHECKSUMS:
728633
boost: 57d2868c099736d80fcd648bf211b4431e51a558
729-
CocoaAsyncSocket: 065fd1e645c7abab64f7a6a2007a48038fdc6a99
730634
DoubleConversion: 5189b271737e1565bdce30deb4a08d647e3f5f54
731635
FBLazyVector: 748c0ef74f2bf4b36cfcccf37916806940a64c32
732636
FBReactNativeSpec: 966f29e4e697de53a3b366355e8f57375c856ad9
733-
Flipper: 6edb735e6c3e332975d1b17956bcc584eccf5818
734-
Flipper-Boost-iOSX: fd1e2b8cbef7e662a122412d7ac5f5bea715403c
735-
Flipper-DoubleConversion: 2dc99b02f658daf147069aad9dbd29d8feb06d30
736-
Flipper-Fmt: 60cbdd92fc254826e61d669a5d87ef7015396a9b
737-
Flipper-Folly: 584845625005ff068a6ebf41f857f468decd26b3
738-
Flipper-Glog: 70c50ce58ddaf67dc35180db05f191692570f446
739-
Flipper-PeerTalk: 116d8f857dc6ef55c7a5a75ea3ceaafe878aadc9
740-
FlipperKit: 2efad7007d6745a3f95e4034d547be637f89d3f6
741637
fmt: ff9d55029c625d3757ed641535fd4a75fedc7ce9
742638
glog: 04b94705f318337d7ead9e6d17c019bd9b1f6b1b
743639
hermes-engine: 8057e75cfc1437b178ac86c8654b24e7fead7f60
744640
libevent: 4049cae6c81cdb3654a443be001fb9bdceff7913
745-
OpenSSL-Universal: ebc357f1e6bc71fa463ccb2fe676756aff50e88c
746641
RCT-Folly: 424b8c9a7a0b9ab2886ffe9c3b041ef628fd4fb1
747642
RCTRequired: 28469809442eb4eb5528462705f7d852948c8a74
748643
RCTTypeSafety: e9c6c409fca2cc584e5b086862d562540cb38d29
@@ -786,7 +681,6 @@ SPEC CHECKSUMS:
786681
SocketRocket: f32cd54efbe0f095c4d7594881e52619cfe80b17
787682
SwiftLint: c1de071d9d08c8aba837545f6254315bc900e211
788683
Yoga: b76f1acfda8212aa16b7e26bcce3983230c82603
789-
YogaKit: f782866e155069a2cca2517aafea43200b01fd5a
790684

791685
PODFILE CHECKSUM: 168602e6106e5ed80179cff5e652b12ee4bce5a9
792686

0 commit comments

Comments
 (0)