feat: 改进 Tailwind CSS v5 开发体验 #82
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: React Native Compatibility | |
| on: | |
| pull_request: | |
| types: [opened, synchronize] | |
| paths: | |
| - 'packages/react-native/**' | |
| - 'packages/weapp-tailwindcss/src/generator/**' | |
| - 'examples/react-native-expo/**' | |
| - 'e2e/react-native/**' | |
| - 'e2e/react-native-*.test.ts' | |
| - package.json | |
| - pnpm-lock.yaml | |
| - .github/workflows/react-native-compatibility.yml | |
| workflow_dispatch: | |
| permissions: | |
| contents: read | |
| jobs: | |
| web: | |
| name: Expo Web compatibility | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 25 | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: pnpm/action-setup@v4 | |
| - uses: actions/setup-node@v6 | |
| with: | |
| node-version: 24 | |
| cache: pnpm | |
| cache-dependency-path: pnpm-lock.yaml | |
| - run: pnpm install --frozen-lockfile | |
| - run: pnpm turbo run build --filter=@weapp-tailwindcss/react-native... | |
| - name: Install Playwright Chromium | |
| run: | | |
| for attempt in 1 2 3 4; do | |
| if pnpm exec playwright install chromium chromium-headless-shell; then | |
| exit 0 | |
| fi | |
| echo "Playwright Chromium install failed, retrying (${attempt}/4)" | |
| sleep $((attempt * 10)) | |
| done | |
| pnpm exec playwright install chromium chromium-headless-shell | |
| - run: pnpm e2e:react-native-compatibility | |
| - run: pnpm e2e:react-native:web | |
| - uses: actions/upload-artifact@v4 | |
| if: always() | |
| with: | |
| name: react-native-web-${{ github.run_id }} | |
| path: e2e/.artifacts/react-native-*/** | |
| if-no-files-found: ignore | |
| include-hidden-files: true | |
| retention-days: 14 | |
| android: | |
| name: Expo Android 11 / API 30 | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 50 | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: pnpm/action-setup@v4 | |
| - uses: actions/setup-node@v6 | |
| with: | |
| node-version: 24 | |
| cache: pnpm | |
| cache-dependency-path: pnpm-lock.yaml | |
| - uses: actions/setup-java@v5 | |
| with: | |
| distribution: temurin | |
| java-version: 17 | |
| - run: pnpm install --frozen-lockfile | |
| - run: pnpm turbo run build --filter=@weapp-tailwindcss/react-native... | |
| - name: Build Android debug APK | |
| run: | | |
| pnpm --filter @weapp-tailwindcss/example-react-native-expo exec expo prebuild --platform android --no-install | |
| cd examples/react-native-expo/android | |
| ./gradlew app:assembleDebug -PreactNativeArchitectures=x86_64 | |
| - uses: reactivecircus/android-emulator-runner@v2 | |
| with: | |
| api-level: 30 | |
| arch: x86_64 | |
| profile: pixel_2 | |
| cores: 2 | |
| ram-size: 4096M | |
| heap-size: 512M | |
| disable-animations: true | |
| disable-spellchecker: true | |
| script: RN_ANDROID_DEVICE_ID=emulator-5554 RN_ANDROID_BINARY=examples/react-native-expo/android/app/build/outputs/apk/debug/app-debug.apk pnpm e2e:react-native:android | |
| - uses: actions/upload-artifact@v4 | |
| if: always() | |
| with: | |
| name: react-native-android-${{ github.run_id }} | |
| path: e2e/.artifacts/react-native-android/** | |
| if-no-files-found: warn | |
| include-hidden-files: true | |
| retention-days: 14 | |
| ios: | |
| name: Expo iOS 18.5 | |
| runs-on: macos-15 | |
| timeout-minutes: 50 | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: pnpm/action-setup@v4 | |
| - uses: actions/setup-node@v6 | |
| with: | |
| node-version: 24 | |
| cache: pnpm | |
| cache-dependency-path: pnpm-lock.yaml | |
| - run: brew install cocoapods | |
| - run: pnpm install --frozen-lockfile | |
| - run: pnpm turbo run build --filter=@weapp-tailwindcss/react-native... | |
| - name: Boot iOS simulator | |
| run: | | |
| udid="$(xcrun simctl create ReactNativeCompatibility 'iPhone 16 Pro' 'com.apple.CoreSimulator.SimRuntime.iOS-18-5')" | |
| echo "RN_IOS_DEVICE_ID=$udid" >> "$GITHUB_ENV" | |
| xcrun simctl boot "$udid" | |
| xcrun simctl bootstatus "$udid" -b | |
| - name: Run Expo iOS compatibility | |
| env: | |
| RN_IOS_HOST: 127.0.0.1 | |
| run: pnpm e2e:react-native:ios | |
| - uses: actions/upload-artifact@v4 | |
| if: always() | |
| with: | |
| name: react-native-ios-${{ github.run_id }} | |
| path: e2e/.artifacts/react-native-ios/** | |
| if-no-files-found: warn | |
| include-hidden-files: true | |
| retention-days: 14 |