Convert Example Apps to TypeScript and Add Expo Support #2650
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: 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 | |
# Install Java 17 | |
- name: Set up Java 17 | |
uses: actions/setup-java@v4 | |
with: | |
distribution: 'temurin' | |
java-version: '17' | |
# 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 | |
# Prebuild the Android folder for Expo | |
- name: Prebuild Android with Expo | |
working-directory: apps/external-display-example | |
run: | | |
yarn 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 assembleDebug |