-
Notifications
You must be signed in to change notification settings - Fork 169
139 lines (137 loc) · 4.82 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
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
name: CI
on: [push, pull_request, workflow_dispatch]
jobs:
js-tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 20
- name: Install yarn
uses: nick-fields/retry@v3
with:
timeout_minutes: 10
retry_wait_seconds: 30
max_attempts: 3
command: npm install -g yarn
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "yarn-cache-dir=$(yarn cache dir)" >> $GITHUB_OUTPUT
- uses: actions/cache@v4
with:
path: ${{ steps.yarn-cache-dir-path.outputs.yarn-cache-dir }}
key: ${{ runner.os }}-yarn-v1-${{ hashFiles('yarn.lock') }}
restore-keys: |
${{ runner.os }}-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
- name: Install yarn
uses: nick-fields/retry@v3
with:
timeout_minutes: 10
retry_wait_seconds: 30
max_attempts: 3
command: npm install -g yarn
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "yarn-cache-dir=$(yarn cache dir)" >> $GITHUB_OUTPUT
- uses: actions/cache@v4
with:
path: ${{ steps.yarn-cache-dir-path.outputs.yarn-cache-dir }}
key: ${{ runner.os }}-yarn-v1-${{ hashFiles('yarn.lock') }}
restore-keys: |
${{ runner.os }}-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: 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
- name: Install yarn
uses: nick-fields/retry@v3
with:
timeout_minutes: 10
retry_wait_seconds: 30
max_attempts: 3
command: npm install -g yarn
- 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
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "yarn-cache-dir=$(yarn cache dir)" >> $GITHUB_OUTPUT
- uses: actions/cache@v4
with:
path: ${{ steps.yarn-cache-dir-path.outputs.yarn-cache-dir }}
key: ${{ runner.os }}-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