1
+ name : CI
2
+ on :
3
+ push :
4
+ branches :
5
+ - main
6
+ pull_request :
7
+ branches :
8
+ - main
9
+ merge_group :
10
+ types :
11
+ - checks_requested
12
+
13
+ jobs :
14
+ lint :
15
+ runs-on : ubuntu-latest
16
+ steps :
17
+ - name : Checkout
18
+ uses : actions/checkout@v3
19
+ with :
20
+ submodules : recursive
21
+
22
+ - name : Setup
23
+ uses : ./.github/actions/setup
24
+ with :
25
+ github_token : ${{ secrets.GITHUB_TOKEN }}
26
+
27
+ - name : Clang Format
28
+ working-directory : packages/skia
29
+ run : yarn clang-format
30
+
31
+ - name : Lint files
32
+ run : yarn lint
33
+
34
+ - name : Typecheck files
35
+ run : yarn tsc
36
+
37
+ test :
38
+ runs-on : ubuntu-latest
39
+ steps :
40
+ - name : Checkout
41
+ uses : actions/checkout@v3
42
+ with :
43
+ submodules : recursive
44
+
45
+ - name : Setup
46
+ uses : ./.github/actions/setup
47
+ with :
48
+ github_token : ${{ secrets.GITHUB_TOKEN }}
49
+
50
+ - name : Test
51
+ run : yarn test
52
+
53
+ build-library :
54
+ runs-on : ubuntu-latest
55
+ steps :
56
+ - name : Checkout
57
+ uses : actions/checkout@v3
58
+ with :
59
+ submodules : recursive
60
+
61
+ - name : Setup
62
+ uses : ./.github/actions/setup
63
+ with :
64
+ github_token : ${{ secrets.GITHUB_TOKEN }}
65
+
66
+ - name : Build package
67
+ run : yarn build
68
+
69
+ build-android :
70
+ runs-on : macos-latest-large
71
+ continue-on-error : true
72
+ env :
73
+ TURBO_CACHE_DIR : .turbo/android
74
+ steps :
75
+ - name : Checkout
76
+ uses : actions/checkout@v3
77
+ with :
78
+ submodules : recursive
79
+
80
+ - name : Setup
81
+ uses : ./.github/actions/setup
82
+ with :
83
+ github_token : ${{ secrets.GITHUB_TOKEN }}
84
+
85
+ - name : Cache turborepo for Android
86
+ uses : actions/cache@v3
87
+ with :
88
+ path : ${{ env.TURBO_CACHE_DIR }}
89
+ key : ${{ runner.os }}-turborepo-android-${{ hashFiles('yarn.lock') }}
90
+ restore-keys : |
91
+ ${{ runner.os }}-turborepo-android
92
+
93
+ - name : Check turborepo cache for Android
94
+ run : |
95
+ 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")
96
+
97
+ if [[ $TURBO_CACHE_STATUS == "HIT" ]]; then
98
+ echo "turbo_cache_hit=1" >> $GITHUB_ENV
99
+ fi
100
+
101
+ - name : Install JDK
102
+ if : env.turbo_cache_hit != 1
103
+ uses : actions/setup-java@v3
104
+ with :
105
+ distribution : ' zulu'
106
+ java-version : ' 17'
107
+
108
+ - name : Install NDK
109
+ if : env.turbo_cache_hit != 1
110
+ uses : nttld/setup-ndk@v1
111
+ id : setup-ndk
112
+ with :
113
+ ndk-version : r26d
114
+
115
+ - name : Set ANDROID_NDK
116
+ run : echo "ANDROID_NDK=$ANDROID_HOME/ndk-bundle" >> $GITHUB_ENV
117
+
118
+ - name : Finalize Android SDK
119
+ if : env.turbo_cache_hit != 1
120
+ run : |
121
+ /bin/bash -c "yes | $ANDROID_HOME/cmdline-tools/latest/bin/sdkmanager --licenses > /dev/null"
122
+
123
+ - name : Install Android SDK
124
+ run : |
125
+ echo "sdk.dir=$ANDROID_HOME" > $GITHUB_WORKSPACE/apps/paper/android/local.properties
126
+ echo "sdk.dir=$ANDROID_HOME" > $GITHUB_WORKSPACE/apps/fabric/android/local.properties
127
+
128
+ - name : Cache Gradle
129
+ if : env.turbo_cache_hit != 1
130
+ uses : actions/cache@v3
131
+ with :
132
+ path : |
133
+ ~/.gradle/wrapper
134
+ ~/.gradle/caches
135
+ key : ${{ runner.os }}-gradle-${{ hashFiles('./apps/paper/android/gradle/wrapper/gradle-wrapper.properties') }}-${{ hashFiles('./apps/fabric/android/gradle/wrapper/gradle-wrapper.properties') }}
136
+ restore-keys : |
137
+ ${{ runner.os }}-gradle-
138
+
139
+ - name : Build example for Android
140
+ env :
141
+ JAVA_OPTS : " -XX:MaxHeapSize=6g"
142
+ run : |
143
+ yarn turbo run build:android --cache-dir="${{ env.TURBO_CACHE_DIR }}" --concurrency 1
144
+
145
+ build-ios :
146
+ runs-on : macos-latest-large
147
+ env :
148
+ TURBO_CACHE_DIR : .turbo/ios
149
+ steps :
150
+ - name : Checkout
151
+ uses : actions/checkout@v3
152
+ with :
153
+ submodules : recursive
154
+
155
+ - name : Setup
156
+ uses : ./.github/actions/setup
157
+ with :
158
+ github_token : ${{ secrets.GITHUB_TOKEN }}
159
+
160
+ - name : Cache turborepo for iOS
161
+ uses : actions/cache@v3
162
+ with :
163
+ path : ${{ env.TURBO_CACHE_DIR }}
164
+ key : ${{ runner.os }}-turborepo-ios-${{ hashFiles('yarn.lock') }}
165
+ restore-keys : |
166
+ ${{ runner.os }}-turborepo-ios-
167
+
168
+ - name : Check turborepo cache for iOS
169
+ run : |
170
+ 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")
171
+
172
+ if [[ $TURBO_CACHE_STATUS == "HIT" ]]; then
173
+ echo "turbo_cache_hit=1" >> $GITHUB_ENV
174
+ fi
175
+
176
+ - name : Cache cocoapods
177
+ if : env.turbo_cache_hit != 1
178
+ id : cocoapods-cache
179
+ uses : actions/cache@v3
180
+ with :
181
+ path : |
182
+ **/ios/Pods
183
+ key : ${{ runner.os }}-cocoapods-${{ hashFiles('./apps/paper/ios/Podfile.lock') }}
184
+ restore-keys : |
185
+ ${{ runner.os }}-cocoapods-
186
+
187
+ - name : Install cocoapods
188
+ run : |
189
+ cd apps/paper/ios
190
+ pod install
191
+ cd ../../fabric/ios
192
+ pod install
193
+ env :
194
+ NO_FLIPPER : 1
195
+
196
+ - name : Build example for iOS
197
+ run : |
198
+ yarn turbo run build:ios --cache-dir="${{ env.TURBO_CACHE_DIR }}"
0 commit comments