Skip to content

refactor/naming_formating #202

refactor/naming_formating

refactor/naming_formating #202

Workflow file for this run

name: CI
on:
push:
branches: [ main, develop ]
pull_request:
branches: [ main, develop ]
workflow_dispatch:
permissions:
pull-requests: write
contents: write
jobs:
run-tests:
name: Execute Tests & Generate Coverage
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup JDK 21
uses: actions/setup-java@v4
with:
java-version: '21'
distribution: 'temurin'
cache: gradle
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Run Unit Tests
run: ./gradlew test
- name: Generate Coverage Report
run: ./gradlew jacocoTestReport
- name: Upload coverage report
uses: actions/upload-artifact@v4
if: always()
with:
name: jacoco-coverage-report
path: build/reports/jacoco/
retention-days: 1
- name: Test Summary
uses: test-summary/action@v2
with:
paths: "**/build/test-results/**/*.xml"
if: always()
analyze-pr:
name: Analyze PR Code Coverage (Only Changed Files)
needs: run-tests
if: github.event_name == 'pull_request'
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Download coverage reports
uses: actions/download-artifact@v4
with:
name: jacoco-coverage-report
path: build/reports/jacoco/
- name: Add coverage results to PR
uses: madrapps/jacoco-report@v1.7.1
with:
paths: ${{ github.workspace }}/build/reports/jacoco/test/jacocoTestReport.xml
token: ${{ secrets.GITHUB_TOKEN }}
min-coverage-overall: 0
min-coverage-changed-files: 80