fix(๐๏ธ): parse dawnToggles properly (#379)
#1413
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: true | |
| - name: Setup | |
| uses: ./.github/actions/setup | |
| with: | |
| github_token: ${{ secrets.GITHUB_TOKEN }} | |
| # `git clean` (checkout clean: true) wipes node_modules/Pods/build so the | |
| # native side rebuilds fresh, but Metro's Haste/transform cache lives | |
| # outside the repo (in $TMPDIR) and survives between runs. After a | |
| # reanimated/worklets bump that stale cache serves JS built by the old | |
| # Babel transform, which shows up as "mismatch between native worklet | |
| # version and JS one". Clear it so the freshly-installed worklets aren't | |
| # shadowed by stale transforms. | |
| - name: Reset React Native caches | |
| run: | | |
| watchman watch-del-all 2>/dev/null || true | |
| TMP="$(node -e 'console.log(require("os").tmpdir())')" | |
| rm -rf "$TMP"/metro-* "$TMP"/haste-map-* 2>/dev/null || true | |
| rm -rf /tmp/metro-* /tmp/haste-map-* 2>/dev/null || true | |
| - name: Lint files | |
| run: yarn lint | |
| - name: Typecheck files | |
| run: yarn tsc | |
| - name: Install CocoaPods | |
| working-directory: apps/example/ios | |
| run: pod install | |
| - name: Ensure Metro port is free | |
| run: | | |
| lsof -ti :8081 | xargs -r kill -9 || true | |
| - name: Start Package Manager | |
| working-directory: apps/example | |
| # --reset-cache: force Metro to re-transform from the freshly-installed | |
| # node_modules instead of reusing the cache that survives `git clean`. | |
| # This is the key guard against the native/JS worklet version mismatch. | |
| run: CI=true yarn start --reset-cache & | |
| - 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: | | |
| # Remove any previous build so a stale binary never lingers on the | |
| # persistent self-hosted simulator. | |
| xcrun simctl uninstall booted com.microsoft.ReactTestApp || true | |
| 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 |