Skip to content

#70 image가 배포되면 helm chart로 pr 날리도록 변경 #160

#70 image가 배포되면 helm chart로 pr 날리도록 변경

#70 image가 배포되면 helm chart로 pr 날리도록 변경 #160

Workflow file for this run

name: Run Tests on Pull Request
on:
pull_request:
branches: ['*']
jobs:
pr-test:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v2
- name: Set up JDK
uses: actions/setup-java@v2
with:
java-version: 11
distribution: 'adopt'
architecture: x64
check-latest: false
server-id: github
server-username: GITHUB_ACTOR
server-password: GITHUB_TOKEN
overwrite-settings: true
job-status: success
- name: Cache SonarQube packages
uses: actions/cache@v1
with:
path: ~/.sonar/cache
key: ${{ runner.os }}-sonar
restore-keys: ${{ runner.os }}-sonar
- name: Cache gradle modules
uses: actions/cache@v2
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
restore-keys: |
${{ runner.os }}-gradle-
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Build with Gradle
env:
USERNAME: ${{secrets.USERNAME}}
TOKEN: ${{secrets.TOKEN}}
GITHUB_TOKEN: ${{ secrets.TOKEN }} # Needed to get PR information, if any
run: ./gradlew clean test jacocoTestReport --stacktrace --profile
- name: SonarQube Scan
uses: sonarsource/sonarqube-scan-action@master
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
SONAR_HOST_URL: ${{ secrets.SONAR_HOST_URL }}
- name: Test Coverage
env:
USERNAME: ${{ secrets.USERNAME }}
TOKEN: ${{ secrets.TOKEN }}
GITHUB_TOKEN: ${{ secrets.TOKEN }} # Needed to get PR information, if any
run: ./gradlew jacocoTestCoverageVerification --stacktrace --profile
- name: Add coverage to PR
id: jacoco
uses: madrapps/[email protected]
with:
title: 📝 테스트 커버리지 리포트입니다
paths: |
${{ github.workspace }}/api/build/reports/**/jacoco.xml
token: ${{ secrets.GITHUB_TOKEN }}
min-coverage-overall: 57.65
min-coverage-changed-files: 100
update-comment: true
- name: Publish Test Report
uses: mikepenz/action-junit-report@v3
if: success() || failure() # always run even if the previous step fails
with:
report_paths: '**/build/test-results/test/TEST-*.xml'