generated from cepdnaclk/eYY-3yp-project-template
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
25874f7
commit 088a017
Showing
1 changed file
with
58 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" |