-
Notifications
You must be signed in to change notification settings - Fork 0
111 lines (103 loc) · 3.64 KB
/
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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
name: Java CI
on: [pull_request]
jobs:
# Build job
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'adopt'
- name: Build with Maven
run: mvn --batch-mode --update-snapshots package
# Upload Designite artifact job
upload-designite-artifact:
runs-on: ubuntu-latest
steps:
- name: Clone tushartushar/DesigniteJava
uses: GuillaumeFalourd/clone-github-repo-action@v2
with:
owner: 'tushartushar'
repository: 'DesigniteJava'
- name: Generate DesigniteJava .jar file
run: |
cd DesigniteJava
mvn package -Dmaven.test.skip
- name: Upload DesigniteJava .jar file
uses: actions/upload-artifact@v3
with:
name: designite-java
path: DesigniteJava/target/DesigniteJava.jar
# Report job
report:
runs-on: ubuntu-latest
needs: upload-designite-artifact
steps:
- uses: actions/checkout@v3
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'adopt'
# Test Coverage
- name: Run Jacoco goal 'report' tied to mvn test
run: mvn test
# Checkstyle
- name: Run Checkstyle goal 'checkstyle'
run: mvn checkstyle:checkstyle
# DesigniteJava
- name: Download designite executable artifact
uses: actions/download-artifact@v3
with:
name: designite-java
- name: Run Designite executable
# from the main folder only
run: java -jar DesigniteJava.jar -i ./src/main -o ./target/designite
# CK Plugin
- name: Run CK plugin goal 'metrics'
run: |
cd ..
git clone https://github.com/jazzmuesli/ck-mvn-plugin.git
cd ck-mvn-plugin
mvn clean install -Dck.version=0.7.0
cd ${{ github.workspace }}
mvn com.github.jazzmuesli:ck-mvn-plugin:metrics -Dck.version=0.7.0
# Metrics
- name: Download JaSoMe release
uses: robinraju/[email protected]
with:
# The source repository path.
repository: "rodhilton/jasome"
tag: "v0.6.8-alpha"
# The name of the file to download.
fileName: "jasome-0.6.8-alpha.zip"
- name: Unzip JaSoMe release
uses: montudor/action-zip@v1
with:
args: unzip -qq jasome-0.6.8-alpha.zip -d jasome-0.6.8-alpha
- name: Generate metrics file
# from the main folder only
run: |
cd jasome-0.6.8-alpha/jasome-0.6.8-alpha
bin/jasome ../../src/main > ../../metrics.xml
# Aggregate Information
- name: Get report info
id: reportsInfo
uses: search-rug/[email protected]
with:
jacoco-html-report: ${{ github.workspace }}/target/site/jacoco/index.html
ck-main-class-csv: ${{ github.workspace }}/src/main/java/class.csv
metrics-xml: ${{ github.workspace }}/metrics.xml
checkstyle-result-xml: ${{ github.workspace }}/target/checkstyle-result.xml
designite-design-result-csv: ${{ github.workspace }}/target/designite/designCodeSmells.csv
designite-implementation-result-csv: ${{ github.workspace }}/target/designite/implementationCodeSmells.csv
- name: Comment PR
uses: thollander/actions-comment-pull-request@v1
# Use the output from the action
with:
message: |
${{ steps.reportsInfo.outputs.report-comment }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}