-
Notifications
You must be signed in to change notification settings - Fork 169
118 lines (115 loc) · 4.02 KB
/
ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
name: CI
on: [push, pull_request, workflow_dispatch]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
js-tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 20
- uses: actions/cache@v4
name: Yarn Cache
id: yarn-cache
with:
path: .yarn/cache
key: ${{ runner.os }}-android-yarn-v1-${{ hashFiles('yarn.lock') }}
restore-keys: ${{ runner.os }}-js-yarn-v1
- name: Install dependencies
uses: nick-fields/retry@v3
with:
timeout_minutes: 10
retry_wait_seconds: 30
max_attempts: 3
command: yarn install
- name: Run tests
run: yarn test
android-build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 20
- uses: actions/cache@v4
name: Yarn Cache
id: yarn-cache
with:
path: .yarn/cache
key: ${{ runner.os }}-android-yarn-v1-${{ hashFiles('yarn.lock') }}
restore-keys: ${{ runner.os }}-android-yarn-v1
- name: Install dependencies
uses: nick-fields/retry@v3
with:
timeout_minutes: 10
retry_wait_seconds: 30
max_attempts: 3
command: yarn install --frozen-lockfile
- name: Install JDK
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '17'
- name: Build android example app
run: yarn example:install && yarn example:devcopy && yarn example:install && cd RNFBSDKExample && cd android && ./gradlew assembleDebug
ios-build:
runs-on: macos-14
steps:
- uses: actions/checkout@v4
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 20
- name: iOS build configured to use current node
run: echo "export NODE_BINARY=`which node`" > RNFBSDKExample/ios/.xcode.env.local
- name: Setup Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: 3
- name: Install cocoapods
run: gem install cocoapods
- name: Install xcbeautify
run: brew install xcbeautify
- uses: hendrikmuhs/ccache-action@v1
name: Xcode Compile Cache
with:
key: ${{ runner.os }}-v1 # makes a unique key w/related restore key internally
max-size: 750M
- uses: actions/cache@v4
name: Yarn Cache
id: yarn-cache
with:
path: .yarn/cache
key: ${{ runner.os }}-ios-yarn-v1-${{ hashFiles('yarn.lock') }}
restore-keys: ${{ runner.os }}-yarn-v1
- uses: actions/cache@v4
name: Cache Pods
id: pods-cache
with:
path: RNFBSDKExample/ios/Pods
key: ${{ runner.os }}-pods-v1-${{ hashFiles('RNFBSDKExample/ios/Podfile.lock') }}
restore-keys: ${{ runner.os }}-pods-v1
- name: Install dependencies
uses: nick-fields/retry@v3
with:
timeout_minutes: 10
retry_wait_seconds: 30
max_attempts: 3
command: yarn && yarn example:install
- name: Build ios example app
run: |
export PATH="/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH"
export CCACHE_SLOPPINESS=clang_index_store,file_stat_matches,include_file_ctime,include_file_mtime,ivfsoverlay,pch_defines,modules,system_headers,time_macros
export CCACHE_FILECLONE=true
export CCACHE_DEPEND=true
export CCACHE_INODECACHE=true
export SKIP_BUNDLING=1
export RCT_NO_LAUNCH_PACKAGER=1
set -o pipefail
yarn example:devcopy && yarn example:install && cd RNFBSDKExample/ios
xcodebuild -scheme RNFBSDKExample -workspace RNFBSDKExample.xcworkspace VALID_ARCHS=\"`uname -m`\" ONLY_ACTIVE_ARCH=YES -sdk iphonesimulator -configuration Debug | xcbeautify