Skip to content
Open

ddd #1243

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
48 changes: 48 additions & 0 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: Java Test Coverage

on:
workflow_dispatch:
inputs:
pr_number:
description: 'PR number from upstream repo'
required: true
type: string
upstream_repo:
description: 'Upstream repo (owner/name)'
required: true
default: 'owner/repo-name' # Change this to your upstream

jobs:
test-coverage:
runs-on: ubuntu-latest

steps:
- name: Checkout fork
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Fetch and checkout upstream PR
run: |
git remote add upstream https://github.com/${{ inputs.upstream_repo }}.git
git fetch upstream pull/${{ inputs.pr_number }}/head:pr-${{ inputs.pr_number }}
git checkout pr-${{ inputs.pr_number }}

- name: Set up JDK 17
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'temurin'
cache: 'maven'

- name: Run tests with coverage
run: mvn clean test jacoco:report

- name: Upload coverage reports
uses: actions/upload-artifact@v4
with:
name: coverage-pr-${{ inputs.pr_number }}
path: |
target/site/jacoco/
target/coverage/
retention-days: 30
20 changes: 20 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,26 @@

<build>
<plugins>
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>0.8.11</version>
<executions>
<execution>
<id>prepare-agent</id>
<goals>
<goal>prepare-agent</goal>
</goals>
</execution>
<execution>
<id>report</id>
<phase>test</phase>
<goals>
<goal>report</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>com.github.ekryd.sortpom</groupId>
<artifactId>sortpom-maven-plugin</artifactId>
Expand Down