Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

merge: (#20) Jacoco 설정 #21

Merged
merged 8 commits into from
Sep 1, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 40 additions & 0 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: CI

on:
push:
branches:
- main
pull_request:
branches:
- main

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: codecov/codecov-action@v1
with:
token: ${{ secrets.CODECOV_TOKEN }}

- name: Set up JDK
uses: actions/setup-java@v2
with:
java-version: '17'
distribution: 'zulu'

- name: Setup Gradle
uses: gradle/gradle-build-action@v2

- name: Grant execute permission for gradlew
run: chmod +x gradlew

- name: codecov gradle
run: ./gradlew test jacocoRootReport

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v2
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: ./build/reports/jacoco/test/jacocoTestReport.xml
22 changes: 11 additions & 11 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,18 +13,18 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Set up JDK 17
uses: actions/setup-java@v1
- uses: actions/checkout@v3

- name: Set up JDK
uses: actions/setup-java@v2
with:
java-version: '17'
distribution: 'zulu'

- name: Grant execute permission for gradlew
run: chmod +x gradlew

- name: Clean Gradle
run: ./gradlew clean

- name: Build with Gradle
run: ./gradlew build --build-cache --configure-on-demand --parallel
- name: Build Gradle
uses: gradle/gradle-build-action@v2
with:
arguments: |
build
--build-cache
--configure-on-demand
21 changes: 21 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ allprojects {
group = "team.comit"
version = "0.0.1-SNAPSHOT"

apply(plugin = "jacoco")

tasks {
compileKotlin {
kotlinOptions {
Expand All @@ -53,6 +55,25 @@ allprojects {
}
}

tasks.register<JacocoReport>("jacocoRootReport") {
subprojects {
[email protected]<JacocoPlugin>().configureEach {
[email protected] {
it.extensions.findByType<JacocoTaskExtension>() != null }
.configureEach {
sourceSets([email protected]<SourceSetContainer>().named("main").get())
executionData(this)
}
}
}

reports {
xml.outputLocation.set(File("${buildDir}/reports/jacoco/test/jacocoTestReport.xml"))
xml.required.set(true)
html.required.set(false)
}
}

tasks.getByName<Jar>("jar") {
enabled = false
}
9 changes: 9 additions & 0 deletions codecov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
codecov:
require_ci_to_pass: yes

comment:
layout: "reach,diff,flags,files,footer"
behavior: default
require_changes: false
branches:
- main