Skip to content

Convert Example Apps to TypeScript and Add Expo Support #2646

Convert Example Apps to TypeScript and Add Expo Support

Convert Example Apps to TypeScript and Add Expo Support #2646

Workflow file for this run

name: CI
on: [push, pull_request]
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/[email protected]
with:
node-version: 18.x
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"
- uses: actions/cache@v4
id: yarn-cache
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Run test
run: |
yarn
yarn lint
test-ios-newarch:
runs-on: macOS-latest
steps:
- uses: actions/checkout@v4
- uses: actions/[email protected]
with:
node-version: 18.x
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"
- uses: actions/cache@v4
id: yarn-cache
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Cache pods
uses: actions/cache@v4
with:
path: |
packages/RNExternalDisplayExample/ios/Pods
packages/RNExternalDisplayExample/ios/build
key: ${{ runner.os }}-pods-newarch-${{ hashFiles('**/packages/RNExternalDisplayExample/Podfile.lock') }}
restore-keys: |
${{ runner.os }}-pods-newarch-
- name: Install deps
run: yarn
- name: Build RNExternalDisplayExample
env:
RCT_NEW_ARCH_ENABLED: 1
run: |
cd packages/RNExternalDisplayExample/ios
pod repo update
pod install
cd ..
xcodebuild -workspace ios/RNExternalDisplayExample.xcworkspace -scheme RNExternalDisplayExample -configuration Debug -sdk iphonesimulator -derivedDataPath ios/build
build-android:
runs-on: ubuntu-latest
steps:
# Checkout the code
- name: Checkout the code
uses: actions/checkout@v4
# Set up Node.js environment
- name: Set up Node.js
uses: actions/[email protected]
with:
node-version: 18.x
# Cache Yarn dependencies to speed up the build
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"
- uses: actions/cache@v4
id: yarn-cache
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
# Install dependencies
- name: Install dependencies
run: yarn
# Navigate to the apps/external-display-example directory
- name: Navigate to external-display-example
working-directory: apps/external-display-example
run: cd apps/external-display-example
# Install Expo CLI globally
- name: Install Expo CLI
run: yarn global add expo-cli
# Prebuild the Android folder for Expo
- name: Prebuild Android with Expo
working-directory: apps/external-display-example
run: |
expo prebuild --platform android
# Build the APK without running on a device
- name: Build Android APK
working-directory: apps/external-display-example/android
run: ./gradlew assembleRelease