From 51144980bc2b77901941236156ab95445da3f66a Mon Sep 17 00:00:00 2001 From: Turtuvshin Byambaa Date: Tue, 16 Jan 2024 16:09:55 +0800 Subject: [PATCH 1/9] created gh action --- github/workflows/react-native-ci.yml | 107 +++++++++++++++++++++++++++ 1 file changed, 107 insertions(+) create mode 100644 github/workflows/react-native-ci.yml diff --git a/github/workflows/react-native-ci.yml b/github/workflows/react-native-ci.yml new file mode 100644 index 0000000..d9597fc --- /dev/null +++ b/github/workflows/react-native-ci.yml @@ -0,0 +1,107 @@ +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.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: Run Jetify + run: npx jetify + + - 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 + + 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 From d5d0ea9db5074706f65f951fa8844da564c36668 Mon Sep 17 00:00:00 2001 From: Turtuvshin Byambaa Date: Tue, 16 Jan 2024 16:11:23 +0800 Subject: [PATCH 2/9] Delete github directory --- github/workflows/react-native-ci.yml | 107 --------------------------- 1 file changed, 107 deletions(-) delete mode 100644 github/workflows/react-native-ci.yml diff --git a/github/workflows/react-native-ci.yml b/github/workflows/react-native-ci.yml deleted file mode 100644 index d9597fc..0000000 --- a/github/workflows/react-native-ci.yml +++ /dev/null @@ -1,107 +0,0 @@ -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.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: Run Jetify - run: npx jetify - - - 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 - - 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 From 2825aa28626816ca6e45239d7f9c4173b3f20c5a Mon Sep 17 00:00:00 2001 From: Turtuvshin Byambaa Date: Tue, 16 Jan 2024 16:12:05 +0800 Subject: [PATCH 3/9] changed .github dir --- .github/workflows/react-native-ci.yml | 107 ++++++++++++++++++++++++++ 1 file changed, 107 insertions(+) create mode 100644 .github/workflows/react-native-ci.yml diff --git a/.github/workflows/react-native-ci.yml b/.github/workflows/react-native-ci.yml new file mode 100644 index 0000000..d9597fc --- /dev/null +++ b/.github/workflows/react-native-ci.yml @@ -0,0 +1,107 @@ +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.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: Run Jetify + run: npx jetify + + - 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 + + 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 From c0da2d7dbf73e27be267942e99b6f3476be608af Mon Sep 17 00:00:00 2001 From: Turtuvshin Byambaa Date: Tue, 16 Jan 2024 16:22:11 +0800 Subject: [PATCH 4/9] removed jetify --- .github/workflows/react-native-ci.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/react-native-ci.yml b/.github/workflows/react-native-ci.yml index d9597fc..331adb2 100644 --- a/.github/workflows/react-native-ci.yml +++ b/.github/workflows/react-native-ci.yml @@ -58,9 +58,6 @@ jobs: distribution: 'oracle' java-version: '17' - - name: Run Jetify - run: npx jetify - - name: Cache Gradle Wrapper uses: actions/cache@v2 with: From cdfcf79accfbaa246dc75c7435e7c1d29068e2b1 Mon Sep 17 00:00:00 2001 From: Turtuvshin Byambaa Date: Tue, 16 Jan 2024 17:06:06 +0800 Subject: [PATCH 5/9] changed google services.json --- .github/workflows/react-native-ci.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/react-native-ci.yml b/.github/workflows/react-native-ci.yml index 331adb2..051eeb0 100644 --- a/.github/workflows/react-native-ci.yml +++ b/.github/workflows/react-native-ci.yml @@ -35,7 +35,7 @@ jobs: - name: Generate google-services.json env: - GOOGLE_SERVICES_JSON: ${{ secrets.GOOGLE_SERVICES_JSON }} + GOOGLE_SERVICES_JSON: ${{ secrets.STOREFRONT_GOOGLE_SERVICES_JSON }} run: | echo "$GOOGLE_SERVICES_JSON" > google-services.json mkdir -p android/app/src @@ -52,11 +52,11 @@ jobs: - name: Install dependencies run: yarn install - - name: Set up JDK 17 + - name: Set up JDK 20 uses: actions/setup-java@v4 with: distribution: 'oracle' - java-version: '17' + java-version: '20' - name: Cache Gradle Wrapper uses: actions/cache@v2 From 00b4577d131e27db486602beb03e2d43e5590fc2 Mon Sep 17 00:00:00 2001 From: Turtuvshin Date: Tue, 16 Jan 2024 17:12:44 +0800 Subject: [PATCH 6/9] fixed unrecognized vm option --- android/gradle.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/android/gradle.properties b/android/gradle.properties index 0e8a917..6a12722 100644 --- a/android/gradle.properties +++ b/android/gradle.properties @@ -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=256m # When configured, Gradle will run in incubating parallel mode. # This option should only be used with decoupled projects. More details, visit From 55d97c109a74f7c9eb660e1130a53fd53a00343a Mon Sep 17 00:00:00 2001 From: Turtuvshin Date: Tue, 16 Jan 2024 17:27:45 +0800 Subject: [PATCH 7/9] increased metaspace size --- android/gradle.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/android/gradle.properties b/android/gradle.properties index 6a12722..8bca34f 100644 --- a/android/gradle.properties +++ b/android/gradle.properties @@ -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:MaxMetaspaceSize=256m +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 From 31089e04473c7f142ba28fdc03a5fda240ec7187 Mon Sep 17 00:00:00 2001 From: Turtuvshin Byambaa Date: Tue, 16 Jan 2024 17:38:44 +0800 Subject: [PATCH 8/9] increased java heap size --- .github/workflows/react-native-ci.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/react-native-ci.yml b/.github/workflows/react-native-ci.yml index 051eeb0..c249d66 100644 --- a/.github/workflows/react-native-ci.yml +++ b/.github/workflows/react-native-ci.yml @@ -52,11 +52,11 @@ jobs: - name: Install dependencies run: yarn install - - name: Set up JDK 20 + - name: Set up JDK 17 uses: actions/setup-java@v4 with: distribution: 'oracle' - java-version: '20' + java-version: '17' - name: Cache Gradle Wrapper uses: actions/cache@v2 @@ -76,6 +76,8 @@ jobs: - name: Build Android run: cd android && ./gradlew assembleDebug + env: + JVM_OPTS: '-Xmx4096m' ios_build: runs-on: macOS-latest From 16583dfba103b61db726848b551ae50bab03d1b1 Mon Sep 17 00:00:00 2001 From: Turtuvshin Byambaa Date: Tue, 16 Jan 2024 17:58:17 +0800 Subject: [PATCH 9/9] added ci badge to readme --- README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/README.md b/README.md index f06aaed..050c519 100644 --- a/README.md +++ b/README.md @@ -15,6 +15,10 @@ Open source ecommerce mobile app for on-demand orders. Setup ecommerce marketpla Bundle Size + + + CI + License