Skip to content

Commit

Permalink
build: expo on the CI
Browse files Browse the repository at this point in the history
  • Loading branch information
okwasniewski committed Nov 16, 2024
1 parent d963c6f commit e585eec
Show file tree
Hide file tree
Showing 12 changed files with 1,490 additions and 1,514 deletions.
106 changes: 106 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,9 @@ jobs:
- name: Setup
uses: ./.github/actions/setup

- name: Build package
run: yarn prepare

- name: Cache turborepo for Android
uses: actions/cache@v3
with:
Expand Down Expand Up @@ -106,6 +109,9 @@ jobs:
- name: Setup
uses: ./.github/actions/setup

- name: Build package
run: yarn prepare

- name: Cache turborepo for Android new arch
uses: actions/cache@v3
with:
Expand Down Expand Up @@ -162,6 +168,9 @@ jobs:
- name: Setup
uses: ./.github/actions/setup

- name: Build package
run: yarn prepare

- name: Cache turborepo for iOS
uses: actions/cache@v3
with:
Expand Down Expand Up @@ -202,6 +211,9 @@ jobs:
- name: Setup
uses: ./.github/actions/setup

- name: Build package
run: yarn prepare

- name: Cache turborepo for iOS
uses: actions/cache@v3
with:
Expand Down Expand Up @@ -230,3 +242,97 @@ jobs:
- name: Build example for iOS
run: |
yarn turbo run build:ios --cache-dir="${{ env.TURBO_CACHE_DIR }}"
build-ios-expo:
runs-on: macos-15
env:
TURBO_CACHE_DIR: .turbo/expo-ios
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Setup
uses: ./.github/actions/setup

- name: Build package
run: yarn prepare

- name: Cache turborepo for iOS
uses: actions/cache@v3
with:
path: ${{ env.TURBO_CACHE_DIR }}
key: ${{ runner.os }}-turborepo-expo-ios-${{ hashFiles('yarn.lock') }}
restore-keys: |
${{ runner.os }}-turborepo-expo-ios-
- name: Check turborepo cache for iOS
run: |
TURBO_CACHE_STATUS=$(node -p "($(yarn turbo run build:ios-expo --cache-dir="${{ env.TURBO_CACHE_DIR }}" --dry=json)).tasks.find(t => t.task === 'build:ios-expo').cache.status")
if [[ $TURBO_CACHE_STATUS == "HIT" ]]; then
echo "turbo_cache_hit=1" >> $GITHUB_ENV
fi
- name: Build example for iOS
run: |
yarn turbo run build:ios-expo --cache-dir="${{ env.TURBO_CACHE_DIR }}"
build-android-expo:
runs-on: ubuntu-latest
env:
TURBO_CACHE_DIR: .turbo/android
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Setup
uses: ./.github/actions/setup

- name: Build package
run: yarn prepare

- name: Cache turborepo for Android
uses: actions/cache@v3
with:
path: ${{ env.TURBO_CACHE_DIR }}
key: ${{ runner.os }}-turborepo-expo-android-${{ hashFiles('yarn.lock') }}
restore-keys: |
${{ runner.os }}-turborepo-expo-android-
- name: Check turborepo cache for Android
run: |
TURBO_CACHE_STATUS=$(node -p "($(yarn turbo run build:android-expo --cache-dir="${{ env.TURBO_CACHE_DIR }}" --dry=json)).tasks.find(t => t.task === 'build:android-expo').cache.status")
if [[ $TURBO_CACHE_STATUS == "HIT" ]]; then
echo "turbo_cache_hit=1" >> $GITHUB_ENV
fi
- name: Install JDK
if: env.turbo_cache_hit != 1
uses: actions/setup-java@v3
with:
distribution: 'zulu'
java-version: '17'

- name: Finalize Android SDK
if: env.turbo_cache_hit != 1
run: |
/bin/bash -c "yes | $ANDROID_HOME/cmdline-tools/latest/bin/sdkmanager --licenses > /dev/null"
- name: Cache Gradle
if: env.turbo_cache_hit != 1
uses: actions/cache@v3
with:
path: |
~/.gradle/wrapper
~/.gradle/caches
key: ${{ runner.os }}-gradle-${{ hashFiles('apps/example/android/gradle/wrapper/gradle-wrapper.properties') }}
restore-keys: |
${{ runner.os }}-gradle-
- name: Build example for Android
env:
JAVA_OPTS: "-XX:MaxHeapSize=6g"
run: |
yarn turbo run build:android-expo --cache-dir="${{ env.TURBO_CACHE_DIR }}"
5 changes: 3 additions & 2 deletions apps/example-expo/app.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
"icon": "./assets/images/icon.png",
"scheme": "myapp",
"userInterfaceStyle": "automatic",
"newArchEnabled": true,
"ios": {
"supportsTablet": true,
"bundleIdentifier": "com.anonymous.bottomtabs"
Expand Down Expand Up @@ -40,10 +39,12 @@
"expo-build-properties",
{
"ios": {
"deploymentTarget": "14.0",
"useFrameworks": "static"
}
}
]
],
"expo-font"
],
"experiments": {
"typedRoutes": true
Expand Down
43 changes: 4 additions & 39 deletions apps/example-expo/app/(tabs)/explore.tsx
Original file line number Diff line number Diff line change
@@ -1,25 +1,14 @@
import { StyleSheet, Image, Platform } from 'react-native';
import { StyleSheet, Image } from 'react-native';

import { Collapsible } from '@/components/Collapsible';
import { ExternalLink } from '@/components/ExternalLink';
import ParallaxScrollView from '@/components/ParallaxScrollView';
import { ThemedText } from '@/components/ThemedText';
import { ThemedView } from '@/components/ThemedView';
import { IconSymbol } from '@/components/ui/IconSymbol';
import { ScrollView } from 'react-native-gesture-handler';

function TabTwoScreen() {
return (
<ParallaxScrollView
headerBackgroundColor={{ light: '#D0D0D0', dark: '#353636' }}
headerImage={
<IconSymbol
size={310}
color="#808080"
name="chevron.left.forwardslash.chevron.right"
style={styles.headerImage}
/>
}
>
<ScrollView>
<ThemedView style={styles.titleContainer}>
<ThemedText type="title">Explore</ThemedText>
</ThemedView>
Expand Down Expand Up @@ -87,31 +76,7 @@ function TabTwoScreen() {
<ThemedText type="link">Learn more</ThemedText>
</ExternalLink>
</Collapsible>
<Collapsible title="Animations">
<ThemedText>
This template includes an example of an animated component. The{' '}
<ThemedText type="defaultSemiBold">
components/HelloWave.tsx
</ThemedText>{' '}
component uses the powerful{' '}
<ThemedText type="defaultSemiBold">
react-native-reanimated
</ThemedText>{' '}
library to create a waving hand animation.
</ThemedText>
{Platform.select({
ios: (
<ThemedText>
The{' '}
<ThemedText type="defaultSemiBold">
components/ParallaxScrollView.tsx
</ThemedText>{' '}
component provides a parallax effect for the header image.
</ThemedText>
),
})}
</Collapsible>
</ParallaxScrollView>
</ScrollView>
);
}

Expand Down
17 changes: 3 additions & 14 deletions apps/example-expo/app/(tabs)/index.tsx
Original file line number Diff line number Diff line change
@@ -1,24 +1,13 @@
import { Image, StyleSheet, Platform } from 'react-native';
import { ScrollView, StyleSheet, Platform } from 'react-native';

import { HelloWave } from '@/components/HelloWave';
import ParallaxScrollView from '@/components/ParallaxScrollView';
import { ThemedText } from '@/components/ThemedText';
import { ThemedView } from '@/components/ThemedView';

function HomeScreen() {
return (
<ParallaxScrollView
headerBackgroundColor={{ light: '#A1CEDC', dark: '#1D3D47' }}
headerImage={
<Image
source={require('@/assets/images/partial-react-logo.png')}
style={styles.reactLogo}
/>
}
>
<ScrollView>
<ThemedView style={styles.titleContainer}>
<ThemedText type="title">Welcome!</ThemedText>
<HelloWave />
</ThemedView>
<ThemedView style={styles.stepContainer}>
<ThemedText type="subtitle">Step 1: Try it</ThemedText>
Expand Down Expand Up @@ -54,7 +43,7 @@ function HomeScreen() {
<ThemedText type="defaultSemiBold">app-example</ThemedText>.
</ThemedText>
</ThemedView>
</ParallaxScrollView>
</ScrollView>
);
}

Expand Down
1 change: 0 additions & 1 deletion apps/example-expo/babel.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ const pak = require('../../packages/react-native-bottom-tabs/package.json');
module.exports = {
presets: ['babel-preset-expo'],
plugins: [
'react-native-reanimated/plugin',
[
'module-resolver',
{
Expand Down
40 changes: 0 additions & 40 deletions apps/example-expo/components/HelloWave.tsx

This file was deleted.

80 changes: 0 additions & 80 deletions apps/example-expo/components/ParallaxScrollView.tsx

This file was deleted.

Loading

0 comments on commit e585eec

Please sign in to comment.