ci: validate JS bundle in example #5
Workflow file for this run
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
| on: | |
| push: | |
| branches: | |
| - main | |
| - v5-launch-prep | |
| pull_request: | |
| branches: | |
| - main | |
| jobs: | |
| lint: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version-file: .nvmrc | |
| - name: Enable Corepack (provides yarn) | |
| run: corepack enable | |
| - name: Cache dependencies | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| **/node_modules | |
| key: ${{ runner.os }}-yarn-${{ hashFiles('example/yarn.lock') }} | |
| restore-keys: | | |
| ${{ runner.os }}-yarn- | |
| - name: Install example dependencies | |
| run: cd example && yarn install | |
| - name: Lint example | |
| run: cd example && yarn lint | |
| bundle: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version-file: .nvmrc | |
| - name: Enable Corepack (provides yarn) | |
| run: corepack enable | |
| - name: Cache dependencies | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| **/node_modules | |
| key: ${{ runner.os }}-yarn-${{ hashFiles('example/yarn.lock') }} | |
| restore-keys: | | |
| ${{ runner.os }}-yarn- | |
| - name: Install example dependencies | |
| run: cd example && yarn install | |
| - name: Bundle JS for Android | |
| run: | | |
| cd example | |
| yarn react-native bundle \ | |
| --platform android \ | |
| --dev false \ | |
| --entry-file index.js \ | |
| --bundle-output /tmp/main.android.jsbundle \ | |
| --assets-dest /tmp/android-assets | |
| - name: Bundle JS for iOS | |
| run: | | |
| cd example | |
| yarn react-native bundle \ | |
| --platform ios \ | |
| --dev false \ | |
| --entry-file index.js \ | |
| --bundle-output /tmp/main.ios.jsbundle \ | |
| --assets-dest /tmp/ios-assets | |
| build-android: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version-file: .nvmrc | |
| - name: Enable Corepack (provides yarn) | |
| run: corepack enable | |
| - name: Install JDK | |
| uses: actions/setup-java@v4 | |
| with: | |
| distribution: "zulu" | |
| java-version: "17" | |
| - name: Finalize Android SDK | |
| run: | | |
| /bin/bash -c "yes | $ANDROID_HOME/cmdline-tools/latest/bin/sdkmanager --licenses > /dev/null" | |
| - name: Cache Gradle | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| ~/.gradle/wrapper | |
| ~/.gradle/caches | |
| key: ${{ runner.os }}-gradle-build-${{ hashFiles('example/android/gradle/wrapper/gradle-wrapper.properties') }} | |
| restore-keys: | | |
| ${{ runner.os }}-gradle-build- | |
| - name: Install example dependencies | |
| run: cd example && yarn install | |
| - name: Build example for Android | |
| env: | |
| JAVA_OPTS: "-XX:MaxHeapSize=6g" | |
| run: cd example/android && ./gradlew assembleDebug | |
| build-ios: | |
| runs-on: macos-15 | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version-file: .nvmrc | |
| - name: Enable Corepack (provides yarn) | |
| run: corepack enable | |
| - name: Install example dependencies | |
| run: cd example && yarn install | |
| - name: Cache cocoapods | |
| id: cocoapods-cache | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| **/ios/Pods | |
| key: ${{ runner.os }}-cocoapods-${{ hashFiles('example/ios/Podfile.lock') }} | |
| restore-keys: | | |
| ${{ runner.os }}-cocoapods- | |
| - name: Install cocoapods | |
| if: steps.cocoapods-cache.outputs.cache-hit != 'true' | |
| run: cd example/ios && pod install | |
| env: | |
| NO_FLIPPER: 1 | |
| - name: Build example for iOS | |
| run: | | |
| cd example/ios | |
| xcodebuild \ | |
| -workspace TrackPlayerExample.xcworkspace \ | |
| -scheme TrackPlayerExample \ | |
| -sdk iphonesimulator \ | |
| -configuration Debug \ | |
| -destination 'platform=iOS Simulator,name=iPhone 16' \ | |
| build \ | |
| | tail -20 |