-
Notifications
You must be signed in to change notification settings - Fork 8
173 lines (143 loc) · 4.37 KB
/
ci.yml
File metadata and controls
173 lines (143 loc) · 4.37 KB
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
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
name: CI
on:
push:
branches:
- main
pull_request:
branches:
- main
merge_group:
types:
- checks_requested
jobs:
lint:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup
uses: ./.github/actions/setup
- name: Lint files
run: yarn lint
- name: Typecheck files
run: yarn typecheck
test:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup
uses: ./.github/actions/setup
build-library:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup
uses: ./.github/actions/setup
- name: Build package
run: yarn prepare
build-android:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup
uses: ./.github/actions/setup
- name: Install JDK
uses: actions/setup-java@v3
with:
distribution: 'zulu'
java-version: '17'
- name: Finalize Android SDK
run: |
/bin/bash -c "yes | $ANDROID_HOME/cmdline-tools/latest/bin/sdkmanager --licenses > /dev/null"
- name: Cache Gradle
uses: actions/cache@v3
with:
path: |
~/.gradle/wrapper
~/.gradle/caches
key: ${{ runner.os }}-gradle-${{ hashFiles('example/android/gradle/wrapper/gradle-wrapper.properties') }}
restore-keys: |
${{ runner.os }}-gradle-
- name: Build Android example (Paper)
env:
JAVA_OPTS: "-XX:MaxHeapSize=6g"
run: yarn android:paper:build
- name: Build Android example (Fabric)
env:
JAVA_OPTS: "-XX:MaxHeapSize=6g"
run: yarn android:fabric:build
build-ios:
runs-on: macos-14
strategy:
fail-fast: false
matrix:
mode: [paper, fabric]
env:
RCT_NEW_ARCH_ENABLED: ${{ matrix.mode == 'fabric' && '1' || '0' }}
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Select Xcode 16.1
uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: '16.1'
- name: Setup
uses: ./.github/actions/setup
- name: Cache CocoaPods
id: cocoapods-cache
uses: actions/cache@v3
with:
path: |
example/ios/Pods
example/ios/build/generated/ios
key: ${{ runner.os }}-cocoapods-${{ matrix.mode }}-${{ hashFiles('example/ios/Podfile.lock') }}
restore-keys: |
${{ runner.os }}-cocoapods-${{ matrix.mode }}-
- name: Install CocoaPods
run: |
cd example/ios
set -o pipefail
if ! pod install; then
echo "pod install failed; retrying after updating hermes-engine" >&2
pod update hermes-engine --no-repo-update
pod install
fi
env:
NO_FLIPPER: 1
- name: Ensure DerivedData directory
run: mkdir -p ~/Library/Developer/Xcode/DerivedData
- name: Cache DerivedData
uses: actions/cache@v3
with:
path: ~/Library/Developer/Xcode/DerivedData/example-*
key: ${{ runner.os }}-deriveddata-${{ matrix.mode }}-${{ hashFiles('example/ios/Podfile.lock') }}
- name: Build iOS example (${{ matrix.mode }})
run: yarn ios:${{ matrix.mode }}:build
build-web:
runs-on: ubuntu-latest
env:
TURBO_CACHE_DIR: .turbo/web
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup
uses: ./.github/actions/setup
- name: Cache turborepo for Web
uses: actions/cache@v3
with:
path: ${{ env.TURBO_CACHE_DIR }}
key: ${{ runner.os }}-turborepo-web-${{ hashFiles('yarn.lock') }}
restore-keys: |
${{ runner.os }}-turborepo-web-
- name: Check turborepo cache for Web
run: |
TURBO_CACHE_STATUS=$(node -p "($(yarn turbo run build:web --cache-dir="${{ env.TURBO_CACHE_DIR }}" --dry=json)).tasks.find(t => t.task === 'build:web').cache.status")
if [[ $TURBO_CACHE_STATUS == "HIT" ]]; then
echo "turbo_cache_hit=1" >> $GITHUB_ENV
fi
- name: Build example for Web
run: |
yarn turbo run build:web --cache-dir="${{ env.TURBO_CACHE_DIR }}"