|
32 | 32 | required: false |
33 | 33 | default: 'Nexus 5X' |
34 | 34 | type: string |
| 35 | + test_web: |
| 36 | + description: 'Run Web tests' |
| 37 | + required: false |
| 38 | + type: boolean |
| 39 | + default: true |
35 | 40 |
|
36 | 41 | jobs: |
37 | 42 | test-skia-ios: |
@@ -73,10 +78,15 @@ jobs: |
73 | 78 | pwd |
74 | 79 |
|
75 | 80 | - name: Create Expo app with Skia template |
76 | | - working-directory: /Users/runner/skia-test-app |
77 | | - run: | |
78 | | - echo "Creating Expo app with Skia template..." |
79 | | - yarn create expo-app my-app -e with-skia |
| 81 | + uses: nick-fields/retry@v3 |
| 82 | + with: |
| 83 | + timeout_minutes: 10 |
| 84 | + max_attempts: 3 |
| 85 | + retry_wait_seconds: 120 |
| 86 | + command: | |
| 87 | + cd /Users/runner/skia-test-app |
| 88 | + echo "Creating Expo app with Skia template..." |
| 89 | + yarn create expo-app my-app -e with-skia |
80 | 90 |
|
81 | 91 | - name: Download artifact package if specified |
82 | 92 | if: startsWith(inputs.skia_version, 'artifact:') |
@@ -230,10 +240,15 @@ jobs: |
230 | 240 | pwd |
231 | 241 |
|
232 | 242 | - name: Create Expo app with Skia template |
233 | | - working-directory: /Users/runner/skia-test-app |
234 | | - run: | |
235 | | - echo "Creating Expo app with Skia template..." |
236 | | - yarn create expo-app my-app -e with-skia |
| 243 | + uses: nick-fields/retry@v3 |
| 244 | + with: |
| 245 | + timeout_minutes: 10 |
| 246 | + max_attempts: 3 |
| 247 | + retry_wait_seconds: 120 |
| 248 | + command: | |
| 249 | + cd /Users/runner/skia-test-app |
| 250 | + echo "Creating Expo app with Skia template..." |
| 251 | + yarn create expo-app my-app -e with-skia |
237 | 252 |
|
238 | 253 | - name: Download artifact package if specified |
239 | 254 | if: startsWith(inputs.skia_version, 'artifact:') |
@@ -342,3 +357,130 @@ jobs: |
342 | 357 | echo "✓ Installed expo-dev-client" |
343 | 358 | echo "✓ Built and ran Android app on API level ${{ inputs.android_api_level }}" |
344 | 359 | echo "================================================================" |
| 360 | +
|
| 361 | + test-skia-web: |
| 362 | + if: inputs.test_web |
| 363 | + runs-on: macos-latest-large |
| 364 | + timeout-minutes: 30 |
| 365 | + |
| 366 | + steps: |
| 367 | + - name: Checkout repository |
| 368 | + uses: actions/checkout@v4 |
| 369 | + |
| 370 | + - name: Setup Node.js |
| 371 | + uses: actions/setup-node@v4 |
| 372 | + with: |
| 373 | + node-version: '20' |
| 374 | + |
| 375 | + - name: Setup Yarn |
| 376 | + run: | |
| 377 | + corepack enable |
| 378 | + yarn --version |
| 379 | +
|
| 380 | + - name: Install Expo CLI |
| 381 | + run: | |
| 382 | + npm install -g expo-cli eas-cli |
| 383 | + expo --version |
| 384 | +
|
| 385 | + - name: Create test directory |
| 386 | + run: | |
| 387 | + mkdir -p /Users/runner/skia-test-app |
| 388 | + cd /Users/runner/skia-test-app |
| 389 | + pwd |
| 390 | +
|
| 391 | + - name: Create Expo app with Skia template |
| 392 | + uses: nick-fields/retry@v3 |
| 393 | + with: |
| 394 | + timeout_minutes: 10 |
| 395 | + max_attempts: 3 |
| 396 | + retry_wait_seconds: 120 |
| 397 | + command: | |
| 398 | + cd /Users/runner/skia-test-app |
| 399 | + echo "Creating Expo app with Skia template..." |
| 400 | + yarn create expo-app my-app -e with-skia |
| 401 | +
|
| 402 | + - name: Download artifact package if specified |
| 403 | + if: startsWith(inputs.skia_version, 'artifact:') |
| 404 | + run: | |
| 405 | + ARTIFACT_ID=$(echo "${{ inputs.skia_version }}" | sed 's/artifact://') |
| 406 | + echo "Downloading artifact ID: $ARTIFACT_ID" |
| 407 | + gh run download --repo Shopify/react-native-skia $ARTIFACT_ID -n package-tgz -D /tmp |
| 408 | + env: |
| 409 | + GH_TOKEN: ${{ github.token }} |
| 410 | + |
| 411 | + - name: Install React Native Skia |
| 412 | + working-directory: /Users/runner/skia-test-app/my-app |
| 413 | + run: | |
| 414 | + VERSION="${{ inputs.skia_version }}" |
| 415 | + if [ "$VERSION" == "latest" ]; then |
| 416 | + echo "Installing @shopify/react-native-skia@latest..." |
| 417 | + yarn add @shopify/react-native-skia@latest |
| 418 | + elif [[ "$VERSION" == artifact:* ]]; then |
| 419 | + echo "Installing @shopify/react-native-skia from downloaded artifact..." |
| 420 | + yarn add @shopify/react-native-skia@file:/tmp/package.tgz |
| 421 | + elif [[ "$VERSION" == http* ]]; then |
| 422 | + echo "Installing @shopify/react-native-skia from URL: $VERSION" |
| 423 | + yarn add @shopify/react-native-skia@"$VERSION" |
| 424 | + else |
| 425 | + echo "Installing @shopify/react-native-skia@$VERSION..." |
| 426 | + yarn add @shopify/react-native-skia@"$VERSION" |
| 427 | + fi |
| 428 | +
|
| 429 | + - name: Show installed Skia version |
| 430 | + working-directory: /Users/runner/skia-test-app/my-app |
| 431 | + run: | |
| 432 | + echo "Installed React Native Skia version:" |
| 433 | + yarn list @shopify/react-native-skia --depth=0 |
| 434 | +
|
| 435 | + - name: Install TypeScript dependencies |
| 436 | + working-directory: /Users/runner/skia-test-app/my-app |
| 437 | + run: | |
| 438 | + echo "Installing TypeScript dependencies..." |
| 439 | + npx expo install typescript @types/react |
| 440 | +
|
| 441 | + - name: Install Playwright dependencies |
| 442 | + run: | |
| 443 | + echo "Installing Playwright..." |
| 444 | + npm install -g playwright |
| 445 | + npx playwright install chromium |
| 446 | + npx playwright install-deps chromium |
| 447 | +
|
| 448 | + - name: Start web server |
| 449 | + working-directory: /Users/runner/skia-test-app/my-app |
| 450 | + run: | |
| 451 | + echo "Starting web server in background..." |
| 452 | + npx expo start --web & |
| 453 | + sleep 30 |
| 454 | +
|
| 455 | + - name: Wait for web app to be ready |
| 456 | + run: | |
| 457 | + echo "Waiting for web app to be accessible..." |
| 458 | + timeout 60 bash -c 'until curl -s http://localhost:8081 > /dev/null; do sleep 2; done' || echo "Web server may not be fully ready" |
| 459 | + echo "Waiting additional time for app to fully render..." |
| 460 | + sleep 30 |
| 461 | +
|
| 462 | + - name: Take screenshot |
| 463 | + if: always() |
| 464 | + run: | |
| 465 | + echo "Taking screenshot of web app..." |
| 466 | + npx playwright screenshot http://localhost:8081 /Users/runner/skia-test-screenshot-web.png || echo "Failed to capture screenshot" |
| 467 | +
|
| 468 | + - name: Upload screenshot |
| 469 | + if: always() |
| 470 | + uses: actions/upload-artifact@v4 |
| 471 | + with: |
| 472 | + name: web-screenshot-${{ github.run_id }} |
| 473 | + path: /Users/runner/skia-test-screenshot-web.png |
| 474 | + if-no-files-found: ignore |
| 475 | + |
| 476 | + - name: Print test summary |
| 477 | + if: always() |
| 478 | + run: | |
| 479 | + echo "================================================================" |
| 480 | + echo "Web Test Summary:" |
| 481 | + echo "================================================================" |
| 482 | + echo "✓ Created Expo app with Skia template" |
| 483 | + echo "✓ Installed @shopify/react-native-skia@${{ inputs.skia_version }}" |
| 484 | + echo "✓ Started web server" |
| 485 | + echo "✓ Web app accessible at http://localhost:8081" |
| 486 | + echo "================================================================" |
0 commit comments