Skip to content

Commit

Permalink
Create react-native-ci.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
KavinduMethpura committed Jan 13, 2025
1 parent 25874f7 commit 088a017
Showing 1 changed file with 58 additions and 0 deletions.
58 changes: 58 additions & 0 deletions .github/workflows/react-native-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,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"

0 comments on commit 088a017

Please sign in to comment.