Skip to content

Commit

Permalink
feat[build]: git workflow add for setup
Browse files Browse the repository at this point in the history
  • Loading branch information
SaifulSaif007 committed Aug 9, 2024
1 parent 55e9a4c commit d2e33b2
Showing 3 changed files with 58 additions and 44 deletions.
48 changes: 31 additions & 17 deletions .github/workflows/dev-workflow.yml
Original file line number Diff line number Diff line change
@@ -7,27 +7,41 @@ on:
- master

jobs:
setup_with_build:
uses: SaifulSaif007/Splash_Image_Gallery/.github/workflows/setup-workflow.yml@git-workflow

build_project:
needs: setup_with_build
build_app:
runs-on: macos-latest

steps:
- name: checkout
uses: actions/checkout@v4

- name: setup JDK 19
uses: actions/setup-java@v4
with:
java-version: '19'
distribution: 'corretto'
cache: 'gradle'
# cache-dependency-path: | # optional
# sub-project/*.gradle*
# sub-project/**/gradle-wrapper.properties

- name: Grant execute permission for gradlew
run: chmod +x gradlew

- name: Run Coverage
run:
./gradlew clean testDebugUnitTestCoverage
- name: Build with Gradle
run: ./gradlew buildDebug --console=plain
env:
CLIENT_ID: ${{ secrets.CLIENT_ID }}

- name: Add coverage to PR only
if: github.event_name == 'pull_request'
id: jacoco
uses: madrapps/jacoco-report@v1.3
with:
paths: ${{ github.workspace }}/build/reports/jacoco/testDebugUnitTestCoverage.xml
token: ${{ secrets.GITHUB_TOKEN }}
min-coverage-overall: 80
min-coverage-changed-files: 80
# - name: Run Coverage
# run:
# ./gradlew clean testDebugUnitTestCoverage
#
# - name: Add coverage to PR only
# if: github.event_name == 'pull_request'
# id: jacoco
# uses: madrapps/jacoco-report@v1.3
# with:
# paths: ${{ github.workspace }}/build/reports/jacoco/testDebugUnitTestCoverage.xml
# token: ${{ secrets.GITHUB_TOKEN }}
# min-coverage-overall: 80
# min-coverage-changed-files: 80
52 changes: 26 additions & 26 deletions .github/workflows/setup-workflow.yml
Original file line number Diff line number Diff line change
@@ -1,28 +1,28 @@
name: Setup Workflow CI

on: workflow_call
jobs:
setup_java:
runs-on: macos-latest

steps:
- name: checkout
uses: actions/checkout@v4

- name: setup JDK 19
uses: actions/setup-java@v4
with:
java-version: '19'
distribution: 'corretto'
cache: 'gradle'
# cache-dependency-path: | # optional
# sub-project/*.gradle*
# sub-project/**/gradle-wrapper.properties

- name: Grant execute permission for gradlew
run: chmod +x gradlew

- name: Build with Gradle
run: ./gradlew buildDebug --console=plain
env:
CLIENT_ID: ${{ secrets.CLIENT_ID }}
#on: workflow_call
#jobs:
# setup_java:
# runs-on: macos-latest
#
# steps:
# - name: checkout
# uses: actions/checkout@v4
#
# - name: setup JDK 19
# uses: actions/setup-java@v4
# with:
# java-version: '19'
# distribution: 'corretto'
# cache: 'gradle'
# # cache-dependency-path: | # optional
# # sub-project/*.gradle*
# # sub-project/**/gradle-wrapper.properties
#
# - name: Grant execute permission for gradlew
# run: chmod +x gradlew
#
# - name: Build with Gradle
# run: ./gradlew buildDebug --console=plain
# env:
# CLIENT_ID: ${{ secrets.CLIENT_ID }}
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -15,5 +15,5 @@ android.defaults.buildfeatures.buildconfig=true
android.enableJetifier=false
android.nonFinalResIds=false
android.useAndroidX=true
clientID=""210rEZdu_UXkCL-ntrKQ9Ya0xsluAbLZAZSR0Y8TkJs"
clientID="210rEZdu_UXkCL-ntrKQ9Ya0xsluAbLZAZSR0Y8TkJs"
org.gradle.jvmargs=-Xmx2048M -Dkotlin.daemon.jvm.options\="-Xmx2048M"

0 comments on commit d2e33b2

Please sign in to comment.