Skip to content

Commit 0af9cd4

Browse files
authored
created gh action (#26) (#27)
1 parent 274df70 commit 0af9cd4

File tree

3 files changed

+111
-1
lines changed

3 files changed

+111
-1
lines changed

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

Lines changed: 106 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,106 @@
1+
name: Storefront App CI
2+
3+
on:
4+
pull_request:
5+
branches: [ main ] # Trigger for PRs to main branch
6+
7+
env:
8+
FLEETBASE_KEY: ${{ secrets.FLEETBASE_KEY }}
9+
GOOGLE_MAPS_KEY: ${{ secrets.GOOGLE_MAPS_KEY }}
10+
ANDROID_KEYSTORE_PASSWORD: ${{ secrets.ANDROID_KEYSTORE_PASSWORD }}
11+
12+
jobs:
13+
install_and_test:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- name: Checkout code
17+
uses: actions/checkout@v3
18+
19+
- name: Install Node.js
20+
uses: actions/setup-node@v1
21+
with:
22+
node-version: 18.x
23+
24+
- name: Install dependencies
25+
run: npm install -g yarn
26+
27+
- name: Install dependencies
28+
run: yarn install
29+
30+
android_build:
31+
runs-on: ubuntu-latest
32+
steps:
33+
- name: Checkout code
34+
uses: actions/checkout@v3
35+
36+
- name: Generate google-services.json
37+
env:
38+
GOOGLE_SERVICES_JSON: ${{ secrets.STOREFRONT_GOOGLE_SERVICES_JSON }}
39+
run: |
40+
echo "$GOOGLE_SERVICES_JSON" > google-services.json
41+
mkdir -p android/app/src
42+
mv google-services.json android/app/src
43+
44+
- name: Install Node.js
45+
uses: actions/setup-node@v1
46+
with:
47+
node-version: 18.x
48+
49+
- name: Install dependencies
50+
run: npm install -g yarn
51+
52+
- name: Install dependencies
53+
run: yarn install
54+
55+
- name: Set up JDK 17
56+
uses: actions/setup-java@v4
57+
with:
58+
distribution: 'oracle'
59+
java-version: '17'
60+
61+
- name: Cache Gradle Wrapper
62+
uses: actions/cache@v2
63+
with:
64+
path: ~/.gradle/wrapper
65+
key: ${{ runner.os }}-gradle-wrapper-${{ hashFiles('gradle/wrapper/gradle-wrapper.properties') }}
66+
67+
- name: Cache Gradle Dependencies
68+
uses: actions/cache@v2
69+
with:
70+
path: ~/.gradle/caches
71+
key: ${{ runner.os }}-gradle-caches-${{ hashFiles('gradle/wrapper/gradle-wrapper.properties') }}
72+
restore-keys: |
73+
${{ runner.os }}-gradle-caches-
74+
- name: Make Gradlew Executable
75+
run: cd android && chmod +x ./gradlew
76+
77+
- name: Build Android
78+
run: cd android && ./gradlew assembleDebug
79+
env:
80+
JVM_OPTS: '-Xmx4096m'
81+
82+
ios_build:
83+
runs-on: macOS-latest
84+
steps:
85+
- name: Checkout code
86+
uses: actions/checkout@v3
87+
88+
- name: Install Node.js
89+
uses: actions/setup-node@v4
90+
with:
91+
node-version: 18.x
92+
93+
- name: Install dependencies
94+
run: npm install -g yarn
95+
96+
- name: Install dependencies
97+
run: yarn install
98+
99+
- name: Install CocoaPods
100+
run: sudo gem install cocoapods
101+
102+
- name: Install iOS pods
103+
run: cd ios && pod install
104+
105+
- name: Build iOS
106+
run: npx react-native run-ios --configuration Release

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,10 @@ Open source ecommerce mobile app for on-demand orders. Setup ecommerce marketpla
1515
<a href="https://bundlephobia.com/package/@fleetbase/[email protected]">
1616
<img src="https://img.shields.io/bundlephobia/min/@fleetbase/storefront" alt="Bundle Size" />
1717
</a>
18+
19+
<a href="https://github.com/fleetbase/storefront-app/actions/workflows/react-native-ci.yml">
20+
<img src="https://github.com/fleetbase/storefront-app/actions/workflows/react-native-ci.yml/badge.svg" alt="CI" />
21+
</a>
1822
<a href="https://github.com/fleetbase/storefront-js/blob/master/LICENSE.md">
1923
<img src="https://img.shields.io/github/license/fleetbase/storefront-js" alt="License" />
2024
</a>

android/gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
# Specifies the JVM arguments used for the daemon process.
1111
# The setting is particularly useful for tweaking memory settings.
1212
# Default value: -Xmx512m -XX:MaxMetaspaceSize=256m
13-
org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m
13+
org.gradle.jvmargs=-Xmx2048m -XX:MaxMetaspaceSize=1g
1414

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

0 commit comments

Comments
 (0)