|
| 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@v5 |
| 19 | + |
| 20 | + - name: Setup Node.js |
| 21 | + uses: actions/setup-node@v4 |
| 22 | + with: |
| 23 | + node-version: 'lts/*' |
| 24 | + |
| 25 | + - name: Enable Corepack and Use Correct Yarn Version |
| 26 | + run: | |
| 27 | + corepack enable |
| 28 | + corepack prepare yarn@4.7.0 --activate |
| 29 | +
|
| 30 | + - name: Restore dependencies |
| 31 | + id: yarn-cache |
| 32 | + uses: actions/cache/restore@v4 |
| 33 | + with: |
| 34 | + path: | |
| 35 | + **/node_modules |
| 36 | + .yarn/install-state.gz |
| 37 | + key: ${{ runner.os }}-yarn-${{ hashFiles('yarn.lock') }}-${{ hashFiles('**/package.json', '!node_modules/**') }} |
| 38 | + restore-keys: | |
| 39 | + ${{ runner.os }}-yarn-${{ hashFiles('yarn.lock') }} |
| 40 | + ${{ runner.os }}-yarn- |
| 41 | +
|
| 42 | + - name: Install dependencies |
| 43 | + if: steps.yarn-cache.outputs.cache-hit != 'true' |
| 44 | + run: yarn install --immutable |
| 45 | + |
| 46 | + - name: Cache dependencies |
| 47 | + if: steps.yarn-cache.outputs.cache-hit != 'true' |
| 48 | + uses: actions/cache/save@v4 |
| 49 | + with: |
| 50 | + path: | |
| 51 | + **/node_modules |
| 52 | + .yarn/install-state.gz |
| 53 | + key: ${{ steps.yarn-cache.outputs.cache-primary-key }} |
| 54 | + |
| 55 | + - name: Lint files |
| 56 | + run: yarn lint |
| 57 | + |
| 58 | + typecheck: |
| 59 | + runs-on: ubuntu-latest |
| 60 | + steps: |
| 61 | + - name: Checkout |
| 62 | + uses: actions/checkout@v5 |
| 63 | + |
| 64 | + - name: Setup Node.js |
| 65 | + uses: actions/setup-node@v4 |
| 66 | + with: |
| 67 | + node-version: 'lts/*' |
| 68 | + |
| 69 | + - name: Enable Corepack and Use Correct Yarn Version |
| 70 | + run: | |
| 71 | + corepack enable |
| 72 | + corepack prepare yarn@4.7.0 --activate |
| 73 | +
|
| 74 | + - name: Restore dependencies |
| 75 | + id: yarn-cache |
| 76 | + uses: actions/cache/restore@v4 |
| 77 | + with: |
| 78 | + path: | |
| 79 | + **/node_modules |
| 80 | + .yarn/install-state.gz |
| 81 | + key: ${{ runner.os }}-yarn-${{ hashFiles('yarn.lock') }}-${{ hashFiles('**/package.json', '!node_modules/**') }} |
| 82 | + restore-keys: | |
| 83 | + ${{ runner.os }}-yarn-${{ hashFiles('yarn.lock') }} |
| 84 | + ${{ runner.os }}-yarn- |
| 85 | +
|
| 86 | + - name: Install dependencies |
| 87 | + if: steps.yarn-cache.outputs.cache-hit != 'true' |
| 88 | + run: yarn install --immutable |
| 89 | + |
| 90 | + - name: Cache dependencies |
| 91 | + if: steps.yarn-cache.outputs.cache-hit != 'true' |
| 92 | + uses: actions/cache/save@v4 |
| 93 | + with: |
| 94 | + path: | |
| 95 | + **/node_modules |
| 96 | + .yarn/install-state.gz |
| 97 | + key: ${{ steps.yarn-cache.outputs.cache-primary-key }} |
| 98 | + |
| 99 | + - name: Typecheck files |
| 100 | + run: yarn typescript |
| 101 | + |
| 102 | + test: |
| 103 | + runs-on: ubuntu-latest |
| 104 | + steps: |
| 105 | + - name: Checkout |
| 106 | + uses: actions/checkout@v5 |
| 107 | + |
| 108 | + - name: Setup Node.js |
| 109 | + uses: actions/setup-node@v4 |
| 110 | + with: |
| 111 | + node-version: 'lts/*' |
| 112 | + |
| 113 | + - name: Enable Corepack and Use Correct Yarn Version |
| 114 | + run: | |
| 115 | + corepack enable |
| 116 | + corepack prepare yarn@4.7.0 --activate |
| 117 | +
|
| 118 | + - name: Restore dependencies |
| 119 | + id: yarn-cache |
| 120 | + uses: actions/cache/restore@v4 |
| 121 | + with: |
| 122 | + path: | |
| 123 | + **/node_modules |
| 124 | + .yarn/install-state.gz |
| 125 | + key: ${{ runner.os }}-yarn-${{ hashFiles('yarn.lock') }}-${{ hashFiles('**/package.json', '!node_modules/**') }} |
| 126 | + restore-keys: | |
| 127 | + ${{ runner.os }}-yarn-${{ hashFiles('yarn.lock') }} |
| 128 | + ${{ runner.os }}-yarn- |
| 129 | +
|
| 130 | + - name: Install dependencies |
| 131 | + if: steps.yarn-cache.outputs.cache-hit != 'true' |
| 132 | + run: yarn install --immutable |
| 133 | + |
| 134 | + - name: Cache dependencies |
| 135 | + if: steps.yarn-cache.outputs.cache-hit != 'true' |
| 136 | + uses: actions/cache/save@v4 |
| 137 | + with: |
| 138 | + path: | |
| 139 | + **/node_modules |
| 140 | + .yarn/install-state.gz |
| 141 | + key: ${{ steps.yarn-cache.outputs.cache-primary-key }} |
| 142 | + |
| 143 | + - name: Run unit tests |
| 144 | + run: yarn test --maxWorkers=2 |
| 145 | + |
| 146 | + build-library: |
| 147 | + runs-on: ubuntu-latest |
| 148 | + steps: |
| 149 | + - name: Checkout |
| 150 | + uses: actions/checkout@v5 |
| 151 | + |
| 152 | + - name: Setup Node.js |
| 153 | + uses: actions/setup-node@v4 |
| 154 | + with: |
| 155 | + node-version: 'lts/*' |
| 156 | + |
| 157 | + - name: Enable Corepack and Use Correct Yarn Version |
| 158 | + run: | |
| 159 | + corepack enable |
| 160 | + corepack prepare yarn@4.7.0 --activate |
| 161 | +
|
| 162 | + - name: Restore dependencies |
| 163 | + id: yarn-cache |
| 164 | + uses: actions/cache/restore@v4 |
| 165 | + with: |
| 166 | + path: | |
| 167 | + **/node_modules |
| 168 | + .yarn/install-state.gz |
| 169 | + key: ${{ runner.os }}-yarn-${{ hashFiles('yarn.lock') }}-${{ hashFiles('**/package.json', '!node_modules/**') }} |
| 170 | + restore-keys: | |
| 171 | + ${{ runner.os }}-yarn-${{ hashFiles('yarn.lock') }} |
| 172 | + ${{ runner.os }}-yarn- |
| 173 | +
|
| 174 | + - name: Install dependencies |
| 175 | + if: steps.yarn-cache.outputs.cache-hit != 'true' |
| 176 | + run: yarn install --immutable |
| 177 | + |
| 178 | + - name: Cache dependencies |
| 179 | + if: steps.yarn-cache.outputs.cache-hit != 'true' |
| 180 | + uses: actions/cache/save@v4 |
| 181 | + with: |
| 182 | + path: | |
| 183 | + **/node_modules |
| 184 | + .yarn/install-state.gz |
| 185 | + key: ${{ steps.yarn-cache.outputs.cache-primary-key }} |
| 186 | + |
| 187 | + - name: Build package |
| 188 | + run: yarn prepare |
| 189 | + |
| 190 | + build-android: |
| 191 | + runs-on: ubuntu-latest |
| 192 | + steps: |
| 193 | + - name: Checkout |
| 194 | + uses: actions/checkout@v5 |
| 195 | + |
| 196 | + - name: Setup Node.js |
| 197 | + uses: actions/setup-node@v4 |
| 198 | + with: |
| 199 | + node-version: 'lts/*' |
| 200 | + |
| 201 | + - name: Enable Corepack and Use Correct Yarn Version |
| 202 | + run: | |
| 203 | + corepack enable |
| 204 | + corepack prepare yarn@4.7.0 --activate |
| 205 | +
|
| 206 | + - name: Restore dependencies |
| 207 | + id: yarn-cache |
| 208 | + uses: actions/cache/restore@v4 |
| 209 | + with: |
| 210 | + path: | |
| 211 | + **/node_modules |
| 212 | + .yarn/install-state.gz |
| 213 | + key: ${{ runner.os }}-yarn-${{ hashFiles('yarn.lock') }}-${{ hashFiles('**/package.json', '!node_modules/**') }} |
| 214 | + restore-keys: | |
| 215 | + ${{ runner.os }}-yarn-${{ hashFiles('yarn.lock') }} |
| 216 | + ${{ runner.os }}-yarn- |
| 217 | +
|
| 218 | + - name: Install dependencies |
| 219 | + if: steps.yarn-cache.outputs.cache-hit != 'true' |
| 220 | + run: yarn install --immutable |
| 221 | + |
| 222 | + - name: Cache dependencies |
| 223 | + if: steps.yarn-cache.outputs.cache-hit != 'true' |
| 224 | + uses: actions/cache/save@v4 |
| 225 | + with: |
| 226 | + path: | |
| 227 | + **/node_modules |
| 228 | + .yarn/install-state.gz |
| 229 | + key: ${{ steps.yarn-cache.outputs.cache-primary-key }} |
| 230 | + |
| 231 | + - name: Install JDK |
| 232 | + uses: actions/setup-java@v4 |
| 233 | + with: |
| 234 | + distribution: 'zulu' |
| 235 | + java-version: '17' |
| 236 | + |
| 237 | + - name: Setup Android SDK |
| 238 | + uses: android-actions/setup-android@v3 |
| 239 | + |
| 240 | + - name: Cache Gradle |
| 241 | + uses: actions/cache@v4 |
| 242 | + with: |
| 243 | + path: | |
| 244 | + ~/.gradle/wrapper |
| 245 | + ~/.gradle/caches |
| 246 | + key: ${{ runner.os }}-gradle-${{ hashFiles('example/android/gradle/wrapper/gradle-wrapper.properties') }} |
| 247 | + restore-keys: | |
| 248 | + ${{ runner.os }}-gradle- |
| 249 | +
|
| 250 | + - name: Build example for Android |
| 251 | + working-directory: example/android |
| 252 | + run: ./gradlew assembleDebug --no-daemon |
| 253 | + |
| 254 | + build-ios: |
| 255 | + runs-on: macos-latest |
| 256 | + steps: |
| 257 | + - name: Checkout |
| 258 | + uses: actions/checkout@v5 |
| 259 | + |
| 260 | + - name: Setup Node.js |
| 261 | + uses: actions/setup-node@v4 |
| 262 | + with: |
| 263 | + node-version: 'lts/*' |
| 264 | + |
| 265 | + - name: Enable Corepack and Use Correct Yarn Version |
| 266 | + run: | |
| 267 | + corepack enable |
| 268 | + corepack prepare yarn@4.7.0 --activate |
| 269 | +
|
| 270 | + - name: Restore dependencies |
| 271 | + id: yarn-cache |
| 272 | + uses: actions/cache/restore@v4 |
| 273 | + with: |
| 274 | + path: | |
| 275 | + **/node_modules |
| 276 | + .yarn/install-state.gz |
| 277 | + key: ${{ runner.os }}-yarn-${{ hashFiles('yarn.lock') }}-${{ hashFiles('**/package.json', '!node_modules/**') }} |
| 278 | + restore-keys: | |
| 279 | + ${{ runner.os }}-yarn-${{ hashFiles('yarn.lock') }} |
| 280 | + ${{ runner.os }}-yarn- |
| 281 | +
|
| 282 | + - name: Install dependencies |
| 283 | + if: steps.yarn-cache.outputs.cache-hit != 'true' |
| 284 | + run: yarn install --immutable |
| 285 | + |
| 286 | + - name: Cache dependencies |
| 287 | + if: steps.yarn-cache.outputs.cache-hit != 'true' |
| 288 | + uses: actions/cache/save@v4 |
| 289 | + with: |
| 290 | + path: | |
| 291 | + **/node_modules |
| 292 | + .yarn/install-state.gz |
| 293 | + key: ${{ steps.yarn-cache.outputs.cache-primary-key }} |
| 294 | + |
| 295 | + - name: Restore CocoaPods cache |
| 296 | + id: cocoapods-cache |
| 297 | + uses: actions/cache/restore@v4 |
| 298 | + with: |
| 299 | + path: | |
| 300 | + example/ios/Pods |
| 301 | + key: ${{ runner.os }}-cocoapods-${{ hashFiles('example/ios/Podfile.lock') }} |
| 302 | + restore-keys: | |
| 303 | + ${{ runner.os }}-cocoapods- |
| 304 | +
|
| 305 | + - name: Install CocoaPods |
| 306 | + if: steps.cocoapods-cache.outputs.cache-hit != 'true' |
| 307 | + working-directory: example/ios |
| 308 | + run: pod install |
| 309 | + |
| 310 | + - name: Cache CocoaPods |
| 311 | + if: steps.cocoapods-cache.outputs.cache-hit != 'true' |
| 312 | + uses: actions/cache/save@v4 |
| 313 | + with: |
| 314 | + path: | |
| 315 | + example/ios/Pods |
| 316 | + key: ${{ steps.cocoapods-cache.outputs.cache-primary-key }} |
| 317 | + |
| 318 | + - name: Build example for iOS |
| 319 | + working-directory: example/ios |
| 320 | + run: | |
| 321 | + xcodebuild -workspace example.xcworkspace \ |
| 322 | + -scheme example \ |
| 323 | + -configuration Debug \ |
| 324 | + -sdk iphonesimulator \ |
| 325 | + -derivedDataPath build \ |
| 326 | + CODE_SIGNING_ALLOWED=NO \ |
| 327 | + COMPILER_INDEX_STORE_ENABLE=NO |
0 commit comments