feat: brownfield unified CLI #311
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
| name: CI | |
| on: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| branches: [main] | |
| concurrency: | |
| group: pr-${{ github.event.pull_request.number }} | |
| cancel-in-progress: true | |
| jobs: | |
| build-lint: | |
| name: Build & static code analysis | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6 | |
| - name: Setup | |
| uses: ./.github/actions/setup | |
| - name: Build packages | |
| run: yarn build | |
| - name: Lint files | |
| run: yarn lint | |
| - name: Typecheck files | |
| run: yarn typecheck | |
| - name: Test Brownfield CLI | |
| run: | | |
| yarn workspace @callstack/react-native-brownfield brownfield --version | |
| android: | |
| name: 'Android: integrated tester & integration workflow with CLI' | |
| runs-on: ubuntu-latest | |
| env: | |
| TURBO_CACHE_DIR: .turbo/android | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@65d868f8d4d85d7d4abb7de0875cde3fcc8798f5 # v6 | |
| with: | |
| node-version: 'lts/*' | |
| cache: 'yarn' | |
| - name: Install dependencies | |
| run: yarn install | |
| - name: Build packages | |
| run: yarn build | |
| - name: Cache turborepo for Android | |
| uses: actions/cache@9255dc7a253b0ccc959486e2bca901246202afeb # v5 | |
| with: | |
| path: ${{ env.TURBO_CACHE_DIR }} | |
| key: ${{ runner.os }}-turborepo-android-${{ hashFiles('yarn.lock') }} | |
| restore-keys: | | |
| ${{ runner.os }}-turborepo-android- | |
| - name: Check turborepo cache for Android | |
| run: | | |
| TURBO_CACHE_STATUS=$(node -p "($(yarn turbo run build:tester-integrated:android --cache-dir="${{ env.TURBO_CACHE_DIR }}" --dry=json)).tasks.find(t => t.task === 'build:tester-integrated:android').cache.status") | |
| if [[ $TURBO_CACHE_STATUS == "HIT" ]]; then | |
| echo "turbo_cache_hit=1" >> $GITHUB_ENV | |
| fi | |
| - name: Validate Gradle Wrapper | |
| if: env.turbo_cache_hit != 1 | |
| uses: gradle/actions/wrapper-validation@6f229686ee4375cc4a86b2514c89bac4930e82c4 # v5 | |
| - name: Setup Java | |
| if: env.turbo_cache_hit != 1 | |
| uses: actions/setup-java@5d7b2146334bacf88728daaa70414a99f5164e0f # v5 | |
| with: | |
| distribution: 'zulu' | |
| java-version: '17' | |
| - name: Restore android build cache | |
| if: env.turbo_cache_hit != 1 | |
| uses: actions/cache@9255dc7a253b0ccc959486e2bca901246202afeb # v5 | |
| with: | |
| path: | | |
| apps/TesterIntegrated/kotlin/build | |
| apps/TesterIntegrated/kotlin/app/.cxx | |
| apps/TesterIntegrated/kotlin/app/build | |
| key: ${{ runner.os }}-tester-android-build-${{ github.sha }} | |
| restore-keys: | | |
| ${{ runner.os }}-tester-android-build- | |
| - name: Restore Gradle cache | |
| if: env.turbo_cache_hit != 1 | |
| uses: actions/cache@9255dc7a253b0ccc959486e2bca901246202afeb # v5 | |
| with: | |
| path: | | |
| ~/.gradle/caches | |
| ~/.gradle/wrapper | |
| key: ${{ runner.os }}-tester-integrated-android-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }} | |
| restore-keys: | | |
| ${{ runner.os }}-tester-integrated-android-gradle- | |
| # == IntegratedTester == | |
| - name: Generate Brownie stores | |
| run: yarn run brownfield:codegen | |
| - name: Build integrated Android tester app | |
| env: | |
| JAVA_OPTS: '-XX:MaxHeapSize=6g' | |
| run: | | |
| yarn turbo run build:tester-integrated:android --cache-dir="${{ env.TURBO_CACHE_DIR }}" | |
| # == RNApp == | |
| - name: Package AAR with the Brownfield CLI | |
| run: | | |
| cd apps/RNApp | |
| yarn run brownfield:package:android | |
| - name: Publish AAR artifact to Maven Local | |
| run: | | |
| cd apps/RNApp | |
| yarn run brownfield:publish:android | |
| - name: Verify debug AAR exists in Maven Local | |
| run: stat ~/.m2/repository/com/rnapp/brownfieldlib/0.0.1-local/brownfieldlib-0.0.1-local-debug.aar | |
| - name: Verify release AAR exists in Maven Local | |
| run: stat ~/.m2/repository/com/rnapp/brownfieldlib/0.0.1-local/brownfieldlib-0.0.1-local-release.aar | |
| # == AndroidApp == | |
| - name: Build native Android Brownfield app | |
| run: | | |
| yarn run build:example:android-consumer | |
| ios: | |
| name: Integrated tester iOS App | |
| runs-on: macos-15 | |
| env: | |
| TURBO_CACHE_DIR: .turbo/ios | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6 | |
| - name: Use appropriate Xcode version | |
| uses: maxim-lobanov/setup-xcode@60606e260d2fc5762a71e64e74b2174e8ea3c8bd # v1.6.0 | |
| with: | |
| xcode-version: '16' | |
| - name: Setup Node.js | |
| uses: actions/setup-node@65d868f8d4d85d7d4abb7de0875cde3fcc8798f5 # v6 | |
| with: | |
| node-version: 'lts/*' | |
| cache: 'yarn' | |
| - name: Setup Ruby | |
| uses: ruby/setup-ruby@5dd816ae0186f20dfa905997a64104db9a8221c7 # v1.280.0 | |
| with: | |
| ruby-version: '3.2' | |
| bundler-cache: true | |
| - name: Install dependencies | |
| run: yarn install | |
| - name: Build packages | |
| run: yarn build | |
| - name: Cache turborepo for iOS | |
| uses: actions/cache@9255dc7a253b0ccc959486e2bca901246202afeb # v5 | |
| with: | |
| path: ${{ env.TURBO_CACHE_DIR }} | |
| key: ${{ runner.os }}-turborepo-ios-${{ hashFiles('yarn.lock') }} | |
| restore-keys: | | |
| ${{ runner.os }}-turborepo-ios- | |
| - name: Check turborepo cache for iOS | |
| run: | | |
| TURBO_CACHE_STATUS=$(node -p "($(yarn turbo run build:tester-integrated:ios --cache-dir="${{ env.TURBO_CACHE_DIR }}" --dry=json)).tasks.find(t => t.task === 'build:tester-integrated:ios').cache.status") | |
| if [[ $TURBO_CACHE_STATUS == "HIT" ]]; then | |
| echo "turbo_cache_hit=1" >> $GITHUB_ENV | |
| fi | |
| - name: Restore Pods cache | |
| if: env.turbo_cache_hit != 1 | |
| uses: actions/cache@9255dc7a253b0ccc959486e2bca901246202afeb # v5 | |
| with: | |
| path: | | |
| apps/TesterIntegrated/swift/Pods | |
| key: ${{ runner.os }}-tester-ios-pods-${{ hashFiles('apps/TesterIntegrated/swift/Podfile.lock') }} | |
| restore-keys: | | |
| ${{ runner.os }}-tester-ios-pods- | |
| - name: Install pods | |
| if: env.turbo_cache_hit != 1 | |
| run: | | |
| cd apps/TesterIntegrated/swift | |
| pod install | |
| # == IntegratedTester == | |
| - name: Build integrated iOS tester app | |
| run: | | |
| yarn turbo run build:tester-integrated:ios --cache-dir="${{ env.TURBO_CACHE_DIR }}" | |
| # == RNApp == | |
| - name: Install pods (RNApp) | |
| run: | | |
| cd apps/RNApp/ios | |
| pod install | |
| - name: Package iOS framework with the Brownfield CLI | |
| run: | | |
| cd apps/RNApp | |
| yarn run brownfield:package:ios | |
| # == AppleApp == | |
| - name: Build Brownfield iOS native app | |
| run: | | |
| yarn run build:example:ios-consumer |