Skip to content

Commit ed32825

Browse files
whitewhite
authored andcommitted
Add Codecov integration and Dependabot configuration
- Add jacoco plugin to root and all subproject build.gradle files - Add Test & Coverage job to CI workflow with codecov-action@v5 - Add Codecov badge to README.md and README.ko.md - Add .github/dependabot.yml for Gradle and GitHub Actions updates
1 parent 3219859 commit ed32825

8 files changed

Lines changed: 114 additions & 0 deletions

File tree

.github/dependabot.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: "gradle"
4+
directory: "/"
5+
schedule:
6+
interval: "weekly"
7+
day: "monday"
8+
time: "09:00"
9+
timezone: "Asia/Seoul"
10+
open-pull-requests-limit: 10
11+
labels:
12+
- "dependencies"
13+
assignees:
14+
- "howtis"
15+
16+
- package-ecosystem: "github-actions"
17+
directory: "/"
18+
schedule:
19+
interval: "weekly"
20+
day: "monday"
21+
time: "09:00"
22+
timezone: "Asia/Seoul"
23+
labels:
24+
- "dependencies"
25+
- "ci"
26+
assignees:
27+
- "howtis"

.github/workflows/ci.yml

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,51 @@ on:
66
pull_request:
77

88
jobs:
9+
test:
10+
name: Test & Coverage
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v4
14+
15+
- name: Set up JDK 17
16+
uses: actions/setup-java@v4
17+
with:
18+
java-version: '17'
19+
distribution: 'temurin'
20+
21+
- name: Set up Gradle
22+
uses: gradle/actions/setup-gradle@v4
23+
with:
24+
cache-encryption-key: ${{ secrets.GRADLE_ENCRYPTION_KEY }}
25+
26+
- name: Cache Python standalone
27+
uses: actions/cache@v4
28+
with:
29+
path: ~/.python-embed
30+
key: python-standalone-${{ runner.os }}-${{ hashFiles('python-embed-gradle-plugin/src/**') }}
31+
32+
- name: Make gradlew executable
33+
run: chmod +x gradlew
34+
35+
- name: Run tests
36+
run: ./gradlew test jacocoTestReport
37+
38+
- name: Upload coverage to Codecov
39+
uses: codecov/codecov-action@v5
40+
with:
41+
token: ${{ secrets.CODECOV_TOKEN }}
42+
fail_ci_if_error: false
43+
44+
- name: Upload test reports
45+
if: failure()
46+
uses: actions/upload-artifact@v4
47+
with:
48+
name: test-reports
49+
path: |
50+
**/build/reports/
51+
**/hs_err_pid*.log
52+
retention-days: 7
53+
954
examples:
1055
name: Run Examples
1156
runs-on: ubuntu-latest

README.ko.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
[![CI](https://github.com/howtis/python-embed/actions/workflows/ci.yml/badge.svg)](https://github.com/howtis/python-embed/actions/workflows/ci.yml)
66
[![Maven Central](https://img.shields.io/maven-central/v/io.github.howtis/python-embed-runtime)](https://central.sonatype.com/artifact/io.github.howtis/python-embed-runtime)
77
[![Gradle Plugin Portal](https://img.shields.io/gradle-plugin-portal/v/io.github.howtis.python-embed)](https://plugins.gradle.org/plugin/io.github.howtis.python-embed)
8+
[![codecov](https://codecov.io/gh/howtis/python-embed/graph/badge.svg?token=CODECOV_TOKEN)](https://codecov.io/gh/howtis/python-embed)
89
[![License](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE)
910

1011
Java에서 Python 코드를 실행하세요 — 완전한 CPython 호환성, 설정 불필요.

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
[![CI](https://github.com/howtis/python-embed/actions/workflows/ci.yml/badge.svg)](https://github.com/howtis/python-embed/actions/workflows/ci.yml)
66
[![Maven Central](https://img.shields.io/maven-central/v/io.github.howtis/python-embed-runtime)](https://central.sonatype.com/artifact/io.github.howtis/python-embed-runtime)
77
[![Gradle Plugin Portal](https://img.shields.io/gradle-plugin-portal/v/io.github.howtis.python-embed)](https://plugins.gradle.org/plugin/io.github.howtis.python-embed)
8+
[![codecov](https://codecov.io/gh/howtis/python-embed/graph/badge.svg?token=CODECOV_TOKEN)](https://codecov.io/gh/howtis/python-embed)
89
[![License](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE)
910

1011
Run Python code from Java — with full CPython compatibility and zero setup.

build.gradle

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
plugins {
22
id 'java'
3+
id 'jacoco'
34
id 'com.vanniktech.maven.publish' version '0.34.0'
45
}
56

@@ -71,5 +72,14 @@ subprojects {
7172
systemProperty 'junit.jupiter.execution.parallel.enabled', 'true'
7273
systemProperty 'junit.jupiter.execution.parallel.mode.default', 'same_thread'
7374
systemProperty 'junit.jupiter.execution.parallel.mode.classes.default', 'concurrent'
75+
finalizedBy(tasks.matching { it.name == 'jacocoTestReport' })
76+
}
77+
78+
jacocoTestReport {
79+
dependsOn test
80+
reports {
81+
xml.required = true
82+
html.required = true
83+
}
7484
}
7585
}

python-embed-build-common/build.gradle

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
plugins {
22
id 'java-library'
3+
id 'jacoco'
34
id 'com.vanniktech.maven.publish' version '0.34.0'
45
}
56

@@ -58,4 +59,13 @@ tasks.named('jar') {
5859

5960
test {
6061
useJUnitPlatform()
62+
finalizedBy jacocoTestReport
63+
}
64+
65+
jacocoTestReport {
66+
dependsOn test
67+
reports {
68+
xml.required = true
69+
html.required = true
70+
}
6171
}

python-embed-gradle-plugin/build.gradle

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
plugins {
22
id 'java'
3+
id 'jacoco'
34
id 'com.gradle.plugin-publish' version '2.1.1'
45
}
56

@@ -56,4 +57,13 @@ tasks.withType(JavaCompile).configureEach {
5657

5758
test {
5859
useJUnitPlatform()
60+
finalizedBy jacocoTestReport
61+
}
62+
63+
jacocoTestReport {
64+
dependsOn test
65+
reports {
66+
xml.required = true
67+
html.required = true
68+
}
5969
}

python-embed-maven-plugin/build.gradle

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
plugins {
22
id 'java'
3+
id 'jacoco'
34
id 'com.vanniktech.maven.publish' version '0.34.0'
45
}
56

@@ -80,4 +81,13 @@ processResources {
8081

8182
test {
8283
useJUnitPlatform()
84+
finalizedBy jacocoTestReport
85+
}
86+
87+
jacocoTestReport {
88+
dependsOn test
89+
reports {
90+
xml.required = true
91+
html.required = true
92+
}
8393
}

0 commit comments

Comments
 (0)