feat: enable new_arch build #295
Workflow file for this run
This file contains 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: iOS Build & Detox | ||
on: | ||
workflow_call: | ||
inputs: | ||
NVMRC: | ||
required: true | ||
type: string | ||
MAP_IMPL: | ||
description: "The map implementation to use (mapbox,mapbox11)" | ||
default: mapbox | ||
required: false | ||
type: string | ||
NEW_ARCH: | ||
description: "If build with new architecture or not" | ||
default: false | ||
required: false | ||
type: boolean | ||
secrets: | ||
MAPBOX_ACCESS_TOKEN: | ||
required: true | ||
MAPBOX_DOWNLOAD_TOKEN: | ||
required: true | ||
jobs: | ||
build: | ||
runs-on: macos-12 | ||
timeout-minutes: 55 | ||
defaults: | ||
run: | ||
working-directory: ./example | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
- name: Access Token | ||
run: echo $MAPBOX_ACCESS_TOKEN > ./accesstoken | ||
env: | ||
MAPBOX_ACCESS_TOKEN: ${{ secrets.MAPBOX_ACCESS_TOKEN }} | ||
- name: Setup .netrc with MAPBOX_DOWNLOAD_TOKEN | ||
run: | | ||
echo 'machine api.mapbox.com' >> ~/.netrc | ||
echo 'login mapbox' >> ~/.netrc | ||
echo "password $MAPBOX_DOWNLOAD_TOKEN" >> ~/.netrc | ||
chmod 0600 ~/.netrc | ||
if: "${{ env.MAPBOX_DOWNLOAD_TOKEN != '' }}" | ||
env: | ||
MAPBOX_DOWNLOAD_TOKEN: ${{ secrets.MAPBOX_DOWNLOAD_TOKEN }} | ||
- name: Setup node ${{ inputs.NVMRC }} | ||
uses: actions/[email protected] | ||
with: | ||
node-version: ${{ inputs.NVMRC }} | ||
- name: Cache node_modules | ||
uses: actions/cache@v3 | ||
id: yarn-cache | ||
with: | ||
path: node_modules | ||
key: node-modules-${{ hashFiles('**/yarn.lock') }} | ||
- name: Install Yarn Dependencies | ||
if: steps.yarn-cache.outputs.cache-hit != 'true' | ||
run: yarn install --network-timeout 1000000 | ||
- name: Cache Pods | ||
uses: actions/cache@v3 | ||
id: pods-cache | ||
with: | ||
path: ios/Pods | ||
key: pods-${{ hashFiles('**/Podfile.lock') }}-${{ inputs.MAP_IMPL }} | ||
- name: Install Pod Dependencies | ||
if: steps.pods-cache.outputs.cache-hit != 'true' | ||
run: cd ios && pod --version && pod update MapboxMaps && pod install | ||
env: | ||
CI_MAP_IMPL: ${{ inputs.MAP_IMPL }} | ||
RCT_NEW_ARCH_ENABLED: ${{ inputs.NEW_ARCH ? 1 : 0 }} | ||
- name: Install Detox Dependencies | ||
run: | | ||
brew tap wix/brew | ||
brew install applesimutils | ||
brew install xcbeautify | ||
- name: Build for detox | ||
run: set -o pipefail && NSUnbufferedIO=YES yarn detox build --configuration ios.debug 2>&1 | xcbeautify -qq | ||
- name: Test with detox | ||
run: | | ||
npx detox --version | ||
yarn detox test --configuration ios.debug --debug-synchronization 500 --loglevel trace --record-logs all --take-screenshots all | ||
env: | ||
SKIP_TESTS_NO_METAL: ${{ inputs.MAP_IMPL == 'mapbox' || inputs.MAP_IMPL == 'mapbox11' }} | ||
- name: Store Detox artifacts on test failure | ||
uses: actions/upload-artifact@v3 | ||
if: failure() | ||
with: | ||
name: detox-artifacts | ||
path: example/artifacts |