|
| 1 | +name: Apple road test (selected RN app & AppleApp) |
| 2 | +description: Package the given RN app as XCFramework, and build the corresponding AppleApp variant |
| 3 | + |
| 4 | +inputs: |
| 5 | + variant: |
| 6 | + description: 'AppleApp yarn command variant to run (expo or vanilla)' |
| 7 | + required: true |
| 8 | + |
| 9 | + rn-project-path: |
| 10 | + description: 'Path to the RN project to build' |
| 11 | + required: true |
| 12 | + |
| 13 | +runs: |
| 14 | + using: composite |
| 15 | + steps: |
| 16 | + - name: Checkout |
| 17 | + uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6 |
| 18 | + |
| 19 | + - name: Setup |
| 20 | + uses: ./.github/actions/setup |
| 21 | + |
| 22 | + - name: Prepare iOS environment |
| 23 | + uses: ./.github/actions/prepare-ios |
| 24 | + |
| 25 | + - name: Configure ccache environment |
| 26 | + run: | |
| 27 | + echo "USE_CCACHE=1" >> "$GITHUB_ENV" |
| 28 | + echo "CCACHE_DIR=${{ github.workspace }}/.ios_ccache" >> "$GITHUB_ENV" |
| 29 | + echo "CCACHE_BASEDIR=${{ github.workspace }}" >> "$GITHUB_ENV" |
| 30 | + echo "CCACHE_COMPRESS=1" >> "$GITHUB_ENV" |
| 31 | + shell: bash |
| 32 | + |
| 33 | + - name: Install ccache |
| 34 | + run: brew install ccache |
| 35 | + shell: bash |
| 36 | + |
| 37 | + - name: Enable ccache |
| 38 | + run: echo "$(brew --prefix)/opt/ccache/libexec" >> $GITHUB_PATH |
| 39 | + shell: bash |
| 40 | + |
| 41 | + - name: Restore RNApp & AppleApp ccache |
| 42 | + uses: actions/cache@9255dc7a253b0ccc959486e2bca901246202afeb # v5 |
| 43 | + with: |
| 44 | + path: | |
| 45 | + .ios_ccache |
| 46 | + key: ${{ runner.os }}-rnapp-appleapp-${{ inputs.variant }}-ios-ccache-${{ hashFiles(format('{0}/ios/Podfile.lock', inputs.rn-project-path), format('{0}/ios/*.xcodeproj/project.pbxproj', inputs.rn-project-path), 'apps/AppleApp/Brownfield Apple App.xcodeproj/project.pbxproj') }} |
| 47 | + restore-keys: | |
| 48 | + ${{ runner.os }}-rnapp-appleapp-${{ inputs.variant }}-ios-ccache- |
| 49 | +
|
| 50 | + # == RN app == |
| 51 | + |
| 52 | + - name: Restore Pods cache (RN ${{ inputs.variant }} app) |
| 53 | + uses: actions/cache@9255dc7a253b0ccc959486e2bca901246202afeb # v5 |
| 54 | + with: |
| 55 | + path: | |
| 56 | + ${{ inputs.rn-project-path }}/ios/Pods |
| 57 | + key: ${{ runner.os }}-rnapp-${{ inputs.variant }}-ios-pods-${{ hashFiles(format('{0}/ios/Podfile.lock', inputs.rn-project-path)) }} |
| 58 | + restore-keys: | |
| 59 | + ${{ runner.os }}-rnapp-${{ inputs.variant }}-ios-pods- |
| 60 | +
|
| 61 | + - name: Install pods (RN ${{ inputs.variant }} app) |
| 62 | + if: inputs.variant == 'vanilla' |
| 63 | + run: | |
| 64 | + cd ${{ inputs.rn-project-path }}/ios |
| 65 | + pod install |
| 66 | + shell: bash |
| 67 | + |
| 68 | + - name: Restore DerivedData cache (RN ${{ inputs.variant }} app) |
| 69 | + uses: actions/cache@v5 |
| 70 | + with: |
| 71 | + path: ${{ inputs.rn-project-path }}/ios/build |
| 72 | + key: ${{ runner.os }}-ios-rnapp-${{ inputs.variant }}-derived-data-${{ hashFiles(format('{0}/ios/Podfile.lock', inputs.rn-project-path), format('{0}/ios/*.xcodeproj/project.pbxproj', inputs.rn-project-path)) }} |
| 73 | + restore-keys: | |
| 74 | + ${{ runner.os }}-ios-rnapp-${{ inputs.variant }}-derived-data- |
| 75 | +
|
| 76 | + - name: Package iOS framework with the Brownfield CLI |
| 77 | + run: | |
| 78 | + cd ${{ inputs.rn-project-path }} |
| 79 | + yarn run brownfield:package:ios |
| 80 | + shell: bash |
| 81 | + |
| 82 | + # == AppleApp == |
| 83 | + |
| 84 | + - name: Build Brownfield iOS native app (${{ inputs.variant }}) |
| 85 | + run: | |
| 86 | + yarn run build:example:ios-consumer:${{ inputs.variant }} |
| 87 | + shell: bash |
| 88 | + |
| 89 | + # ============== |
| 90 | + |
| 91 | + - name: Log ccache stats |
| 92 | + uses: ./.github/actions/ccache-summary |
| 93 | + with: |
| 94 | + name: RN ${{ inputs.variant }} app & AppleApp |
0 commit comments