Skip to content

Commit 2d6a40d

Browse files
committed
feat: react native sdk
1 parent 7598d9a commit 2d6a40d

File tree

191 files changed

+16608
-1506
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

191 files changed

+16608
-1506
lines changed
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: Setup React Native dependencies
2+
description: Setup Node.js and install dependencies
3+
4+
runs:
5+
using: composite
6+
steps:
7+
- name: Setup Node.js
8+
uses: actions/setup-node@v4
9+
with:
10+
node-version-file: .nvmrc
11+
12+
- name: Change to React Native package directory
13+
run: cd ./packages/sdk-platforms/react-native/react-native-zksync-sso
14+
shell: bash
15+
16+
- name: Restore dependencies
17+
id: yarn-cache
18+
uses: actions/cache/restore@v4
19+
with:
20+
path: |
21+
./packages/sdk-platforms/react-native/react-native-zksync-sso/node_modules
22+
./packages/sdk-platforms/react-native/react-native-zksync-sso/.yarn/install-state.gz
23+
key: ${{ runner.os }}-yarn-rn-${{ hashFiles('./packages/sdk-platforms/react-native/react-native-zksync-sso/yarn.lock') }}-${{ hashFiles('./packages/sdk-platforms/react-native/react-native-zksync-sso/package.json') }}
24+
restore-keys: |
25+
${{ runner.os }}-yarn-rn-${{ hashFiles('./packages/sdk-platforms/react-native/react-native-zksync-sso/yarn.lock') }}
26+
${{ runner.os }}-yarn-rn-
27+
28+
- name: Install dependencies
29+
if: steps.yarn-cache.outputs.cache-hit != 'true'
30+
run: cd ./packages/sdk-platforms/react-native/react-native-zksync-sso && yarn install --immutable
31+
shell: bash
32+
33+
- name: Cache dependencies
34+
if: steps.yarn-cache.outputs.cache-hit != 'true'
35+
uses: actions/cache/save@v4
36+
with:
37+
path: |
38+
./packages/sdk-platforms/react-native/react-native-zksync-sso/node_modules
39+
./packages/sdk-platforms/react-native/react-native-zksync-sso/.yarn/install-state.gz
40+
key: ${{ steps.yarn-cache.outputs.cache-primary-key }}
Lines changed: 173 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,173 @@
1+
name: CI React Native
2+
on:
3+
push:
4+
branches:
5+
- main
6+
paths:
7+
- 'packages/sdk-platforms/react-native/react-native-zksync-sso/**'
8+
pull_request:
9+
branches:
10+
- main
11+
paths:
12+
- 'packages/sdk-platforms/react-native/react-native-zksync-sso/**'
13+
merge_group:
14+
types:
15+
- checks_requested
16+
17+
defaults:
18+
run:
19+
working-directory: ./packages/sdk-platforms/react-native/react-native-zksync-sso
20+
21+
jobs:
22+
lint:
23+
runs-on: ubuntu-latest
24+
steps:
25+
- name: Checkout
26+
uses: actions/checkout@v4
27+
28+
- name: Setup
29+
uses: ./.github/actions/setupreactnative
30+
31+
- name: Lint files
32+
run: yarn lint
33+
34+
- name: Typecheck files
35+
run: yarn typecheck
36+
37+
test:
38+
runs-on: ubuntu-latest
39+
steps:
40+
- name: Checkout
41+
uses: actions/checkout@v4
42+
43+
- name: Setup
44+
uses: ./.github/actions/setupreactnative
45+
46+
- name: Run unit tests
47+
run: yarn test --maxWorkers=2 --coverage
48+
49+
build-library:
50+
runs-on: ubuntu-latest
51+
steps:
52+
- name: Checkout
53+
uses: actions/checkout@v4
54+
55+
- name: Setup
56+
uses: ./.github/actions/setupreactnative
57+
58+
- name: Build package
59+
run: yarn prepare
60+
61+
build-android:
62+
runs-on: ubuntu-latest
63+
env:
64+
TURBO_CACHE_DIR: ./packages/sdk-platforms/react-native/react-native-zksync-sso/.turbo/android
65+
steps:
66+
- name: Checkout
67+
uses: actions/checkout@v4
68+
69+
- name: Setup
70+
uses: ./.github/actions/setupreactnative
71+
72+
- name: Cache turborepo for Android
73+
uses: actions/cache@v4
74+
with:
75+
path: ${{ env.TURBO_CACHE_DIR }}
76+
key: ${{ runner.os }}-turborepo-android-${{ hashFiles('./packages/sdk-platforms/react-native/react-native-zksync-sso/yarn.lock') }}
77+
restore-keys: |
78+
${{ runner.os }}-turborepo-android-
79+
80+
- name: Check turborepo cache for Android
81+
run: |
82+
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")
83+
84+
if [[ $TURBO_CACHE_STATUS == "HIT" ]]; then
85+
echo "turbo_cache_hit=1" >> $GITHUB_ENV
86+
fi
87+
88+
- name: Install JDK
89+
if: env.turbo_cache_hit != 1
90+
uses: actions/setup-java@v4
91+
with:
92+
distribution: 'zulu'
93+
java-version: '17'
94+
95+
- name: Finalize Android SDK
96+
if: env.turbo_cache_hit != 1
97+
run: |
98+
/bin/bash -c "yes | $ANDROID_HOME/cmdline-tools/latest/bin/sdkmanager --licenses > /dev/null"
99+
100+
- name: Cache Gradle
101+
if: env.turbo_cache_hit != 1
102+
uses: actions/cache@v4
103+
with:
104+
path: |
105+
~/.gradle/wrapper
106+
~/.gradle/caches
107+
key: ${{ runner.os }}-gradle-${{ hashFiles('./packages/sdk-platforms/react-native/react-native-zksync-sso/example/android/gradle/wrapper/gradle-wrapper.properties') }}
108+
restore-keys: |
109+
${{ runner.os }}-gradle-
110+
111+
- name: Build example for Android
112+
env:
113+
JAVA_OPTS: "-XX:MaxHeapSize=6g"
114+
run: |
115+
yarn turbo run build:android --cache-dir="${{ env.TURBO_CACHE_DIR }}"
116+
117+
build-ios:
118+
runs-on: macos-latest
119+
env:
120+
TURBO_CACHE_DIR: ./packages/sdk-platforms/react-native/react-native-zksync-sso/.turbo/ios
121+
steps:
122+
- name: Checkout
123+
uses: actions/checkout@v4
124+
125+
- name: Setup
126+
uses: ./.github/actions/setupreactnative
127+
128+
- name: Cache turborepo for iOS
129+
uses: actions/cache@v4
130+
with:
131+
path: ${{ env.TURBO_CACHE_DIR }}
132+
key: ${{ runner.os }}-turborepo-ios-${{ hashFiles('./packages/sdk-platforms/react-native/react-native-zksync-sso/yarn.lock') }}
133+
restore-keys: |
134+
${{ runner.os }}-turborepo-ios-
135+
136+
- name: Check turborepo cache for iOS
137+
run: |
138+
TURBO_CACHE_STATUS=$(node -p "($(yarn turbo run build:ios --cache-dir="${{ env.TURBO_CACHE_DIR }}" --dry=json)).tasks.find(t => t.task === 'build:ios').cache.status")
139+
140+
if [[ $TURBO_CACHE_STATUS == "HIT" ]]; then
141+
echo "turbo_cache_hit=1" >> $GITHUB_ENV
142+
fi
143+
144+
- name: Restore cocoapods
145+
if: env.turbo_cache_hit != 1
146+
id: cocoapods-cache
147+
uses: actions/cache/restore@v4
148+
with:
149+
path: |
150+
./packages/sdk-platforms/react-native/react-native-zksync-sso/**/ios/Pods
151+
key: ${{ runner.os }}-cocoapods-${{ hashFiles('./packages/sdk-platforms/react-native/react-native-zksync-sso/example/ios/Podfile.lock') }}
152+
restore-keys: |
153+
${{ runner.os }}-cocoapods-
154+
155+
- name: Install cocoapods
156+
if: env.turbo_cache_hit != 1 && steps.cocoapods-cache.outputs.cache-hit != 'true'
157+
run: |
158+
cd example/ios
159+
pod install
160+
env:
161+
NO_FLIPPER: 1
162+
163+
- name: Cache cocoapods
164+
if: env.turbo_cache_hit != 1 && steps.cocoapods-cache.outputs.cache-hit != 'true'
165+
uses: actions/cache/save@v4
166+
with:
167+
path: |
168+
./packages/sdk-platforms/react-native/react-native-zksync-sso/**/ios/Pods
169+
key: ${{ steps.cocoapods-cache.outputs.cache-key }}
170+
171+
- name: Build example for iOS
172+
run: |
173+
yarn turbo run build:ios --cache-dir="${{ env.TURBO_CACHE_DIR }}"
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# EditorConfig helps developers define and maintain consistent
2+
# coding styles between different editors and IDEs
3+
# editorconfig.org
4+
5+
root = true
6+
7+
[*]
8+
9+
indent_style = space
10+
indent_size = 2
11+
12+
end_of_line = lf
13+
charset = utf-8
14+
trim_trailing_whitespace = true
15+
insert_final_newline = true
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
*.pbxproj -text
2+
# specific for windows script files
3+
*.bat text eol=crlf
Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
# OSX
2+
#
3+
.DS_Store
4+
5+
# XDE
6+
.expo/
7+
8+
# VSCode
9+
.vscode/
10+
jsconfig.json
11+
12+
# Xcode
13+
#
14+
build/
15+
*.pbxuser
16+
!default.pbxuser
17+
*.mode1v3
18+
!default.mode1v3
19+
*.mode2v3
20+
!default.mode2v3
21+
*.perspectivev3
22+
!default.perspectivev3
23+
xcuserdata
24+
*.xccheckout
25+
*.moved-aside
26+
DerivedData
27+
*.hmap
28+
*.ipa
29+
*.xcuserstate
30+
project.xcworkspace
31+
**/.xcode.env.local
32+
33+
# Android/IJ
34+
#
35+
.classpath
36+
.cxx
37+
.gradle
38+
.idea
39+
.project
40+
.settings
41+
local.properties
42+
android.iml
43+
44+
# Cocoapods
45+
#
46+
example/ios/Pods
47+
48+
# Ruby
49+
example/vendor/
50+
51+
# node.js
52+
#
53+
node_modules/
54+
npm-debug.log
55+
yarn-debug.log
56+
yarn-error.log
57+
58+
# BUCK
59+
buck-out/
60+
\.buckd/
61+
android/app/libs
62+
android/keystores/debug.keystore
63+
64+
# Yarn
65+
.yarn/*
66+
!.yarn/patches
67+
!.yarn/plugins
68+
!.yarn/releases
69+
!.yarn/sdks
70+
!.yarn/versions
71+
72+
# Expo
73+
.expo/
74+
75+
# Turborepo
76+
.turbo/
77+
78+
# generated by bob
79+
lib/
80+
81+
# React Native Codegen
82+
ios/generated
83+
android/generated
84+
85+
# React Native Nitro Modules
86+
nitrogen/
87+
88+
# React Native
89+
.yarn/*
90+
ZksyncSsoFramework.xcframework
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
v20
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
nodeLinker: node-modules
2+
nmHoistingLimits: workspaces
3+
4+
plugins:
5+
- path: .yarn/plugins/@yarnpkg/plugin-interactive-tools.cjs
6+
spec: "@yarnpkg/plugin-interactive-tools"
7+
- path: .yarn/plugins/@yarnpkg/plugin-workspace-tools.cjs
8+
spec: "@yarnpkg/plugin-workspace-tools"
9+
10+
yarnPath: .yarn/releases/yarn-3.6.1.cjs

0 commit comments

Comments
 (0)