-
Notifications
You must be signed in to change notification settings - Fork 2
65 lines (53 loc) · 1.87 KB
/
Copy pathcoverage.yml
File metadata and controls
65 lines (53 loc) · 1.87 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
name: Coverage
on:
pull_request:
branches: ["dev", "main"]
env:
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true
concurrency:
group: coverage-${{ github.ref }}
cancel-in-progress: true
jobs:
coverage:
runs-on: [self-hosted, Linux, X64, ci-stack]
steps:
- uses: actions/checkout@v7
with:
fetch-depth: 0
- name: Isolate Gradle user home
run: echo "GRADLE_USER_HOME=${RUNNER_TEMP}/gradle-user-home" >> "$GITHUB_ENV"
- name: Set up JDK 25
uses: actions/setup-java@v5
with:
java-version: "25"
distribution: temurin
- uses: gradle/actions/setup-gradle@v6
- name: Detect affected test modules
id: affected
env:
AFFECTED_GRADLE_TASK: test
run: bash .github/scripts/ci-affected-tasks.sh
- name: Run affected tests and coverage report
if: steps.affected.outputs.tasks != ''
env:
TASKS: ${{ steps.affected.outputs.tasks }}
run: |
readarray -t task_args <<<"$TASKS"
printf 'Running affected tests:\n%s\n' "$TASKS"
./gradlew "${task_args[@]}" --parallel --max-workers=32
./gradlew jacocoTestReport jacocoTestCoverageVerification --parallel --max-workers=32
- name: No coverage required
if: steps.affected.outputs.tasks == ''
run: echo "No source or build changes require coverage."
- name: Upload coverage HTML report
if: always() && steps.affected.outputs.tasks != ''
uses: actions/upload-artifact@v7
with:
name: jacoco-html-report
path: build/reports/jacoco/test/html
- name: Upload coverage XML report
if: always() && steps.affected.outputs.tasks != ''
uses: actions/upload-artifact@v7
with:
name: jacoco-xml-report
path: build/reports/jacoco/test/jacocoTestReport.xml