Skip to content

Merge pull request #10 from e20370rashmika/main #13

Merge pull request #10 from e20370rashmika/main

Merge pull request #10 from e20370rashmika/main #13

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

Check failure on line 35 in .github/workflows/react-native-ci.yml

View workflow run for this annotation

GitHub Actions / .github/workflows/react-native-ci.yml

Invalid workflow file

You have an error in your yaml syntax on line 35
- 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"