generated from cepdnaclk/eYY-3yp-project-template
-
Notifications
You must be signed in to change notification settings - Fork 2
58 lines (47 loc) · 1.47 KB
/
react-native-ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
name: React Native CI
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
build:
name: Build and Test
runs-on: ubuntu-latest
steps:
# Step 1: Checkout Repository
- name: Checkout Repository
uses: actions/checkout@v3
# Step 2: Set up Node.js
- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: 16 # Ensure the Node.js version matches your project
# Step 3: Install Dependencies
- name: Install Dependencies
run: npm install
# Step 4: Run Tests
- name: Run Tests
run: npm test
# Step 5: Build Project for Android
- name: Set up JDK 11
uses: actions/setup-java@v3
with:
java-version: '11' # Ensure this matches the version your project requires
- name: Check JDK version
run: java -version # This confirms the JDK is correctly set up
- name: Install Android Dependencies
run: |
cd android
./gradlew clean
./gradlew assembleDebug # or assembleRelease depending on your build type
- name: Build Project for Android
run: |
npx react-native info # Check React Native environment info
echo "Building Android project..."
cd android
./gradlew assembleDebug # For a debug build, replace with assembleRelease for production build
# Optionally, you can create the APK after the build completes
echo "Build completed. APK located at android/app/build/outputs/apk/debug/app-debug.apk"