-
Notifications
You must be signed in to change notification settings - Fork 34
70 lines (63 loc) · 2.47 KB
/
sub_jacoco_report.yml
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
66
67
68
69
70
name: Generate Jacoco Coverage Report
on:
workflow_dispatch:
workflow_call:
inputs:
forceRebuild:
type: boolean
description: 'Force Gradle rebuild (true/false)'
required: false
default: false
jobs:
jacoco-report:
name: Generate Jacoco Coverage Report
runs-on: ubuntu-latest
steps:
#############################################
# Setup JDK 17
# Download, and Extract anchor-platform.tar
# Setup hostnames (/etc/hosts)
#############################################
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'adopt'
- name: Download anchor-platform.tar
uses: actions/download-artifact@v3
with:
name: anchor-platform-tar
path: /home/runner/
- name: Extract anchor-platform.tar
run: |
cd /home/runner
tar -xf /home/runner/anchor-platform.tar
cd /home/runner/anchor-platform
- name: Set up hostnames (/etc/hosts)
run: |
sudo echo "127.0.0.1 db" | sudo tee -a /etc/hosts
sudo echo "127.0.0.1 kafka" | sudo tee -a /etc/hosts
sudo echo "127.0.0.1 sep24-reference-ui" | sudo tee -a /etc/hosts
sudo echo "127.0.0.1 reference-server" | sudo tee -a /etc/hosts
sudo echo "127.0.0.1 reference-db" | sudo tee -a /etc/hosts
sudo echo "127.0.0.1 wallet-server" | sudo tee -a /etc/hosts
sudo echo "127.0.0.1 platform" | sudo tee -a /etc/hosts
sudo echo "127.0.0.1 custody-server" | sudo tee -a /etc/hosts
sudo echo "127.0.0.1 host.docker.internal" | sudo tee -a /etc/hosts
#############################################
- name: Gradle Build with unit tests only
if : ${{ inputs.forceRebuild }}
run: |
cd /home/runner/anchor-platform
./gradlew clean build jacocoTestReport -x essential-tests:test -x extended-tests:test
- name: Add coverage to the Pull Request
id: jacoco
uses: madrapps/[email protected]
with:
# The path to the jacocoTestReport.xml files which were generated in the previous workflow
paths: /home/runner/java-stellar-sdk/**/build/reports/jacoco/test/jacocoTestReport.xml
token: ${{ secrets.GITHUB_TOKEN }}
min-coverage-overall: 40
min-coverage-changed-files: 60
title: Code Coverage
update-comment: true