fix(🎇): hdr support #1288
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: CI | |
| on: | |
| push: | |
| branches: | |
| - main | |
| pull_request: | |
| branches: | |
| - main | |
| merge_group: | |
| types: | |
| - checks_requested | |
| workflow_dispatch: | |
| concurrency: | |
| group: ci-${{ github.event.pull_request.number || github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| build: | |
| runs-on: self-hosted | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| with: | |
| clean: false | |
| - name: Setup | |
| uses: ./.github/actions/setup | |
| with: | |
| github_token: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Lint files | |
| run: yarn lint | |
| - name: Typecheck files | |
| run: yarn tsc | |
| - name: Install CocoaPods | |
| working-directory: apps/example/ios | |
| run: | | |
| HASH_FILE="/tmp/.podfile-lock-hash" | |
| CURRENT_HASH=$(shasum Podfile.lock | cut -d' ' -f1) | |
| if [ -f "$HASH_FILE" ] && [ "$(cat "$HASH_FILE")" = "$CURRENT_HASH" ] && [ -d "Pods" ]; then | |
| echo "Podfile.lock unchanged and Pods exists — skipping pod install" | |
| else | |
| pod install | |
| echo "$CURRENT_HASH" > "$HASH_FILE" | |
| fi | |
| - name: Ensure Metro port is free | |
| run: | | |
| lsof -ti :8081 | xargs -r kill -9 || true | |
| - name: Start Package Manager | |
| working-directory: apps/example | |
| run: CI=true yarn start & | |
| - name: Build example for iOS | |
| working-directory: apps/example/ios | |
| run: | | |
| set -o pipefail && xcodebuild \ | |
| -workspace example.xcworkspace \ | |
| -scheme Example \ | |
| -configuration Debug \ | |
| -sdk iphonesimulator \ | |
| -destination "generic/platform=iOS Simulator" \ | |
| -derivedDataPath build \ | |
| COMPILER_INDEX_STORE_ENABLE=NO \ | |
| DISABLE_MANUAL_TARGET_ORDER_BUILD_WARNING=YES \ | |
| -disableAutomaticPackageResolution \ | |
| build | xcpretty | |
| - name: Boot iPhone Simulator | |
| run: | | |
| if xcrun simctl list devices booted | grep -q "iPhone"; then | |
| echo "Simulator already booted" | |
| else | |
| DEVICE_UDID=$(xcrun simctl list devices available -j | python3 -c " | |
| import json, sys | |
| data = json.load(sys.stdin) | |
| for runtime, devices in data['devices'].items(): | |
| if 'iOS' in runtime: | |
| for d in devices: | |
| if 'iPhone' in d['name'] and d['isAvailable']: | |
| print(d['udid']) | |
| sys.exit(0) | |
| sys.exit(1) | |
| ") | |
| echo "Booting simulator $DEVICE_UDID" | |
| xcrun simctl boot "$DEVICE_UDID" | |
| xcrun simctl bootstatus "$DEVICE_UDID" -b | |
| fi | |
| - name: Install and launch app on Simulator | |
| run: | | |
| xcrun simctl install booted apps/example/ios/build/Build/Products/Debug-iphonesimulator/ReactTestApp.app | |
| xcrun simctl launch booted com.microsoft.ReactTestApp | |
| - name: Run e2e tests | |
| working-directory: packages/webgpu | |
| run: yarn test | |
| - name: Detect ANDROID_HOME | |
| run: | | |
| if [ -n "$ANDROID_HOME" ] && [ -d "$ANDROID_HOME" ]; then | |
| echo "ANDROID_HOME already set: $ANDROID_HOME" | |
| echo "ANDROID_HOME=$ANDROID_HOME" >> $GITHUB_ENV | |
| else | |
| for candidate in \ | |
| "$HOME/android-sdk" \ | |
| "$HOME/Library/Android/sdk" \ | |
| "/usr/local/share/android-commandlinetools" \ | |
| "/opt/android/sdk"; do | |
| if [ -d "$candidate" ]; then | |
| echo "ANDROID_HOME=$candidate" >> $GITHUB_ENV | |
| echo "Found ANDROID_HOME: $candidate" | |
| break | |
| fi | |
| done | |
| fi | |
| - name: Install NDK | |
| uses: nttld/setup-ndk@afb4c9964b521afb97c864b7d40b11e6911bd410 # v1.5.0 | |
| id: setup-ndk | |
| with: | |
| ndk-version: r27d | |
| - name: Set ANDROID_NDK | |
| run: echo "ANDROID_NDK=${{ steps.setup-ndk.outputs.ndk-path }}" >> $GITHUB_ENV | |
| - name: Finalize Android SDK | |
| run: | | |
| yes | "$ANDROID_HOME/cmdline-tools/latest/bin/sdkmanager" --licenses > /dev/null | |
| - name: Install Android SDK | |
| run: echo "sdk.dir=$ANDROID_HOME" > $GITHUB_WORKSPACE/apps/example/android/local.properties | |
| - name: Build example for Android | |
| working-directory: apps/example/android | |
| env: | |
| JAVA_OPTS: "-XX:MaxHeapSize=6g" | |
| run: ./gradlew assembleDebug --build-cache --warning-mode all |