Skip to content

Commit

Permalink
Merge pull request Create react-native-ci.yml (#16)
Browse files Browse the repository at this point in the history
* Add React Native workflow for CI

* Update react-native-ci.yml to add comments

* Fix workflow directory issue

* Fix Build process error for  React Native CI workflow

* Update React Native CI workflow with distribution field

* Fix working directory for React Native CI workflow

* Update Java version to 17 for Android Gradle compatibility

* Add GitHub Actions workflow for Android APK build

* Update Android SDK installation and APK build process

* Added react-native-ci.yml comments

* change push and pull branches to main

---------

Co-authored-by: Mary Jabro <maryjabro@wayne.edu>
  • Loading branch information
maryjabro and Mary Jabro authored Sep 15, 2024
1 parent 7f5ae76 commit b4c9587
Showing 1 changed file with 59 additions and 0 deletions.
59 changes: 59 additions & 0 deletions .github/workflows/react-native-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
name: React Native Frontend CI


on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]

jobs:
build:
runs-on: ubuntu-latest

steps:
# Checkout the repository
- name: Checkout repository
uses: actions/checkout@v4

# Set up Node.js version 18
- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: '18'

# Install Node.js dependencies
- name: Install Node.js dependencies
run: npm install
working-directory: VitalTrackApp

# Run Unit Tests using Jest
- name: Run Unit Tests
run: npm run test
working-directory: VitalTrackApp

# Set up JDK 17 for Android
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'

# Install Android SDK Command-line Tools
- name: Install Android SDK
run: |
sudo apt-get update
sudo apt-get install -y wget unzip
wget https://dl.google.com/android/repository/commandlinetools-linux-8092744_latest.zip
mkdir -p $HOME/Android/cmdline-tools
unzip commandlinetools-linux-8092744_latest.zip -d $HOME/Android/cmdline-tools
export ANDROID_HOME=$HOME/Android
export PATH=$ANDROID_HOME/cmdline-tools/cmdline-tools/bin:$PATH
sdkmanager --sdk_root=$ANDROID_HOME --licenses
sdkmanager --sdk_root=$ANDROID_HOME "platform-tools" "platforms;android-34" "build-tools;34.0.0"
# Build Android APK
- name: Build Android APK
run: ./gradlew assembleDebug
working-directory: VitalTrackApp/android

0 comments on commit b4c9587

Please sign in to comment.