Skip to content

[YS-39] chore: JaCoCo 및 소나클라우드 연동 #17

[YS-39] chore: JaCoCo 및 소나클라우드 연동

[YS-39] chore: JaCoCo 및 소나클라우드 연동 #17

Workflow file for this run

name: Java CI with Gradle
on:
push:
branches:
- main
- dev
pull_request:
branches:
- main
- dev
jobs:
test:
name: Code Quality Check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'temurin'
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Cache SonarCloud packages
uses: actions/cache@v4
with:
path: ~/.sonar/cache
key: ${{ runner.os }}-sonar
restore-keys: ${{ runner.os }}-sonar
- name: Setup Gradle
uses: gradle/gradle-build-action@v2
with:
arguments: check
cache-read-only: ${{ github.ref != 'refs/heads/main' && github.ref != 'refs/heads/dev' }}
- name: Build and analyze
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
run: ./gradlew build sonar --info
continue-on-error: true # 빌드 실패하더라도 이후 아티팩트 업로드가 실행되도록 설정
- name: Upload problems report as artifact
if: always()
uses: actions/upload-artifact@v3
with:
name: sonar-problems-report
path: build/reports/problems/problems-report.html