Skip to content

Commit 674fd73

Browse files
committed
Add example app build check CIs
1 parent 736fb7b commit 674fd73

1 file changed

Lines changed: 190 additions & 0 deletions

File tree

Lines changed: 190 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,190 @@
1+
name: 🏗️ Build Example Apps
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
paths:
8+
- 'example/**'
9+
- 'packages/react-native-sortables/**'
10+
- '.github/workflows/build-examples.yml'
11+
pull_request:
12+
branches:
13+
- main
14+
paths:
15+
- 'example/**'
16+
- 'packages/react-native-sortables/**'
17+
- '.github/workflows/build-examples.yml'
18+
workflow_dispatch: # Allow manual triggering
19+
20+
env:
21+
NODE_VERSION: '20'
22+
23+
jobs:
24+
# Build Expo app locally (no EAS required)
25+
build-expo:
26+
name: 📱 Build Expo App
27+
runs-on: ubuntu-latest
28+
concurrency:
29+
group: build-expo-${{ github.ref }}
30+
cancel-in-progress: true
31+
32+
steps:
33+
- name: 🛒 Checkout code
34+
uses: actions/checkout@v4
35+
36+
- name: 🔧 Setup Node.js
37+
uses: actions/setup-node@v4
38+
with:
39+
node-version: ${{ env.NODE_VERSION }}
40+
cache: 'yarn'
41+
42+
- name: 📦 Install dependencies
43+
run: yarn install --immutable
44+
45+
- name: 🏗️ Build library
46+
run: yarn build
47+
48+
- name: 📱 Install Expo CLI
49+
run: npm install -g @expo/cli
50+
51+
- name: 🌐 Install Expo dependencies
52+
working-directory: example/expo
53+
run: yarn install --immutable
54+
55+
- name: 🔍 Validate Expo configuration
56+
working-directory: example/expo
57+
run: npx expo doctor
58+
59+
- name: 🏗️ Build Expo bundle
60+
working-directory: example/expo
61+
run: npx expo export --platform all
62+
63+
- name: 📦 Upload Expo build artifacts
64+
uses: actions/upload-artifact@v4
65+
with:
66+
name: expo-build
67+
path: example/expo/dist/
68+
retention-days: 7
69+
70+
# Build React Native apps (Fabric and Paper)
71+
build-react-native:
72+
name: 📱 Build ${{ matrix.app }} (${{ matrix.platform }})
73+
runs-on: macos-15
74+
strategy:
75+
matrix:
76+
app: [fabric, paper]
77+
platform: [ios, android]
78+
concurrency:
79+
group: build-${{ matrix.app }}-${{ matrix.platform }}-${{ github.ref }}
80+
cancel-in-progress: true
81+
82+
steps:
83+
- name: 🛒 Checkout code
84+
uses: actions/checkout@v4
85+
86+
- name: 🔧 Setup Node.js
87+
uses: actions/setup-node@v4
88+
with:
89+
node-version: ${{ env.NODE_VERSION }}
90+
cache: 'yarn'
91+
92+
- name: 📦 Install dependencies
93+
run: yarn install --immutable
94+
95+
- name: 🏗️ Build library
96+
run: yarn build
97+
98+
- name: 🍎 Setup Ruby (iOS only)
99+
if: matrix.platform == 'ios'
100+
uses: ruby/setup-ruby@v1
101+
with:
102+
ruby-version: '3.3'
103+
bundler-cache: true
104+
105+
- name: 🍎 Select Xcode (iOS only)
106+
if: matrix.platform == 'ios'
107+
run: sudo xcode-select --switch /Applications/Xcode_16.4.app
108+
109+
- name: ☕ Setup Java (Android only)
110+
if: matrix.platform == 'android'
111+
uses: actions/setup-java@v4
112+
with:
113+
distribution: 'temurin'
114+
java-version: '17'
115+
116+
- name: 🤖 Setup Android SDK (Android only)
117+
if: matrix.platform == 'android'
118+
uses: android-actions/setup-android@v3
119+
120+
- name: 📱 Install dependencies for ${{ matrix.app }}
121+
working-directory: example/${{ matrix.app }}
122+
run: yarn install --immutable
123+
124+
- name: 🍎 Install pods (iOS only)
125+
if: matrix.platform == 'ios'
126+
working-directory: example/${{ matrix.app }}/ios
127+
run: |
128+
bundle install
129+
bundle exec pod update
130+
131+
- name: 🍎 Build iOS
132+
if: matrix.platform == 'ios'
133+
working-directory: example/${{ matrix.app }}
134+
run: |
135+
xcodebuild -workspace ios/*.xcworkspace -scheme * -configuration Debug -destination 'platform=iOS Simulator,name=iPhone 15,OS=latest' build
136+
137+
- name: 🤖 Build Android
138+
if: matrix.platform == 'android'
139+
working-directory: example/${{ matrix.app }}
140+
run: |
141+
cd android
142+
./gradlew assembleDebug
143+
144+
- name: 📦 Upload build artifacts
145+
uses: actions/upload-artifact@v4
146+
with:
147+
name: ${{ matrix.app }}-${{ matrix.platform }}-build
148+
path: |
149+
example/${{ matrix.app }}/ios/build/ (iOS)
150+
example/${{ matrix.app }}/android/app/build/ (Android)
151+
retention-days: 7
152+
153+
# Build Web app
154+
build-web:
155+
name: 🌐 Build Web App
156+
runs-on: ubuntu-latest
157+
concurrency:
158+
group: build-web-${{ github.ref }}
159+
cancel-in-progress: true
160+
161+
steps:
162+
- name: 🛒 Checkout code
163+
uses: actions/checkout@v4
164+
165+
- name: 🔧 Setup Node.js
166+
uses: actions/setup-node@v4
167+
with:
168+
node-version: ${{ env.NODE_VERSION }}
169+
cache: 'yarn'
170+
171+
- name: 📦 Install dependencies
172+
run: yarn install --immutable
173+
174+
- name: 🏗️ Build library
175+
run: yarn build
176+
177+
- name: 🌐 Install web dependencies
178+
working-directory: example/web
179+
run: yarn install --immutable
180+
181+
- name: 🌐 Build web app
182+
working-directory: example/web
183+
run: yarn expo export -p web
184+
185+
- name: 📦 Upload web build artifacts
186+
uses: actions/upload-artifact@v4
187+
with:
188+
name: web-build
189+
path: example/web/dist/
190+
retention-days: 7

0 commit comments

Comments
 (0)