Skip to content

Commit

Permalink
created gh action (#26) (#27)
Browse files Browse the repository at this point in the history
  • Loading branch information
tortuvshin authored Jan 16, 2024
1 parent 274df70 commit 0af9cd4
Show file tree
Hide file tree
Showing 3 changed files with 111 additions and 1 deletion.
106 changes: 106 additions & 0 deletions .github/workflows/react-native-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
name: Storefront App CI

on:
pull_request:
branches: [ main ] # Trigger for PRs to main branch

env:
FLEETBASE_KEY: ${{ secrets.FLEETBASE_KEY }}
GOOGLE_MAPS_KEY: ${{ secrets.GOOGLE_MAPS_KEY }}
ANDROID_KEYSTORE_PASSWORD: ${{ secrets.ANDROID_KEYSTORE_PASSWORD }}

jobs:
install_and_test:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Install Node.js
uses: actions/setup-node@v1
with:
node-version: 18.x

- name: Install dependencies
run: npm install -g yarn

- name: Install dependencies
run: yarn install

android_build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Generate google-services.json
env:
GOOGLE_SERVICES_JSON: ${{ secrets.STOREFRONT_GOOGLE_SERVICES_JSON }}
run: |
echo "$GOOGLE_SERVICES_JSON" > google-services.json
mkdir -p android/app/src
mv google-services.json android/app/src
- name: Install Node.js
uses: actions/setup-node@v1
with:
node-version: 18.x

- name: Install dependencies
run: npm install -g yarn

- name: Install dependencies
run: yarn install

- name: Set up JDK 17
uses: actions/setup-java@v4
with:
distribution: 'oracle'
java-version: '17'

- name: Cache Gradle Wrapper
uses: actions/cache@v2
with:
path: ~/.gradle/wrapper
key: ${{ runner.os }}-gradle-wrapper-${{ hashFiles('gradle/wrapper/gradle-wrapper.properties') }}

- name: Cache Gradle Dependencies
uses: actions/cache@v2
with:
path: ~/.gradle/caches
key: ${{ runner.os }}-gradle-caches-${{ hashFiles('gradle/wrapper/gradle-wrapper.properties') }}
restore-keys: |
${{ runner.os }}-gradle-caches-
- name: Make Gradlew Executable
run: cd android && chmod +x ./gradlew

- name: Build Android
run: cd android && ./gradlew assembleDebug
env:
JVM_OPTS: '-Xmx4096m'

ios_build:
runs-on: macOS-latest
steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Install Node.js
uses: actions/setup-node@v4
with:
node-version: 18.x

- name: Install dependencies
run: npm install -g yarn

- name: Install dependencies
run: yarn install

- name: Install CocoaPods
run: sudo gem install cocoapods

- name: Install iOS pods
run: cd ios && pod install

- name: Build iOS
run: npx react-native run-ios --configuration Release
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ Open source ecommerce mobile app for on-demand orders. Setup ecommerce marketpla
<a href="https://bundlephobia.com/package/@fleetbase/[email protected]">
<img src="https://img.shields.io/bundlephobia/min/@fleetbase/storefront" alt="Bundle Size" />
</a>

<a href="https://github.com/fleetbase/storefront-app/actions/workflows/react-native-ci.yml">
<img src="https://github.com/fleetbase/storefront-app/actions/workflows/react-native-ci.yml/badge.svg" alt="CI" />
</a>
<a href="https://github.com/fleetbase/storefront-js/blob/master/LICENSE.md">
<img src="https://img.shields.io/github/license/fleetbase/storefront-js" alt="License" />
</a>
Expand Down
2 changes: 1 addition & 1 deletion android/gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
# Specifies the JVM arguments used for the daemon process.
# The setting is particularly useful for tweaking memory settings.
# Default value: -Xmx512m -XX:MaxMetaspaceSize=256m
org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m
org.gradle.jvmargs=-Xmx2048m -XX:MaxMetaspaceSize=1g

# When configured, Gradle will run in incubating parallel mode.
# This option should only be used with decoupled projects. More details, visit
Expand Down

0 comments on commit 0af9cd4

Please sign in to comment.