Skip to content

Add: jacoco, separate gradle script #2

Add: jacoco, separate gradle script

Add: jacoco, separate gradle script #2

name: check convention, test w/ jacoco
on:
pull_request:
branches:
- main
env:
REVIEWERS: 2jie0516, kys0411, Hejow
DEFAULT_OS: ubuntu-latest
GRADLE_VERSION: 8.3
JAVA_VERSION: '17'
JAVA_DISTRIBUTION: 'temurin'
GRADLE_BUILD_ACTION_CACHE_DEBUG_ENABLED: true
JACOCO_TEST_REPORT: /build/reports/jacoco/test/jacocoTestReport.xml
jobs:
assign-reviewer:
runs-on: ubuntu-latest
steps:
- name: Assign Reviewer
uses: hkusu/review-assign-action@v1
with:
assignees: ${{ github.actor }}
reviewers: ${{ env.REVIEWERS }}
check:
needs: assign-reviewer
runs-on: ubuntu-latest
steps:
- name: Checkout Branch
uses: actions/checkout@v4
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: ${{ env.JAVA_VERSION }}
distribution: ${{ env.JAVA_DISTRIBUTION }}
- name: Setup Gradle w/ caching
uses: gradle/[email protected]
with:
gradle-version: ${{ env.GRADLE_VERSION }}
cache-read-only: true # will be update
- name: Check Code Convention
run: gradle check
- name: Check Tests w/ Test Coverage
run: gradle testWithCoverage
- name: Add Coverage on Pull Request
id: jacoco
uses: madrapps/[email protected]
with:
title: Test Coverage Report
paths: ${{ github.workspace }}${{ env.JACOCO_TEST_REPORT }}
token: ${{ secrets.GITHUB_TOKEN }}
min-coverage-overall: 80
min-coverage-changed-files: 80
build:
needs: check
runs-on: ubuntu-latest
steps:
- name: Checkout Branch
uses: actions/checkout@v4
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: ${{ env.JAVA_VERSION }}
distribution: ${{ env.JAVA_DISTRIBUTION }}
- name: Clean Build w/o TEST, CHECK
uses: gradle/[email protected]
with:
arguments: clean build -x test -x check