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 Jul 29, 2024
1 parent 3fc32b1 commit b24cc8f
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 25 deletions.
24 changes: 18 additions & 6 deletions .github/workflows/dev-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,27 @@ on:
- master

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

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

steps:
- name: Build with Gradle
run: ./gradlew buildDebug --console=plain
env:
CLIENT_ID: ${{ secrets.CLIENT_ID }}
- name: Grant execute permission for gradlew
run: chmod +x gradlew

- 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
43 changes: 24 additions & 19 deletions .github/workflows/setup-workflow.yml
Original file line number Diff line number Diff line change
@@ -1,23 +1,28 @@
name: Setup Workflow CI
name: Setup Workflow CI

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

steps:
- name: checkout
uses: actions/checkout@v4
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: 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: Grant execute permission for gradlew
run: chmod +x gradlew

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

0 comments on commit b24cc8f

Please sign in to comment.