File tree Expand file tree Collapse file tree 1 file changed +52
-0
lines changed
Expand file tree Collapse file tree 1 file changed +52
-0
lines changed Original file line number Diff line number Diff line change 1+ # This workflow will build a Java project with Maven
2+ # For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven
3+
4+ name : contentstack-management-java
5+
6+ on :
7+ push :
8+ branches : [ master ]
9+ pull_request :
10+ branches : [ master ]
11+
12+ jobs :
13+ build :
14+ runs-on : ubuntu-latest
15+
16+ steps :
17+ - uses : actions/checkout@v2
18+
19+ - name : Set up JDK 1.8
20+ uses : actions/setup-java@v1
21+ with :
22+ java-version : 1.8
23+
24+ - name : Build with Maven
25+ run : mvn -B test
26+
27+ - name : Generate JaCoCo Badge
28+ id : jacoco
29+ uses : cicirello/jacoco-badge-generator@v2.0.1
30+ with :
31+ generate-branches-badge : true
32+
33+ - name : Log coverage percentage
34+ run : |
35+ echo "coverage = ${{ steps.jacoco.outputs.coverage }}"
36+ echo "branch coverage = ${{ steps.jacoco.outputs.branches }}"
37+
38+ - name : Commit the badge (if it changed)
39+ run : |
40+ if [[ `git status --porcelain` ]]; then
41+ git config --global user.name 'YOUR NAME HERE'
42+ git config --global user.email 'YOUR-GITHUB-USERID@users.noreply.github.com'
43+ git add -A
44+ git commit -m "Autogenerated JaCoCo coverage badge"
45+ git push
46+ fi
47+
48+ - name : Upload JaCoCo coverage report
49+ uses : actions/upload-artifact@v2
50+ with :
51+ name : jacoco-report
52+ path : target/site/jacoco/
You can’t perform that action at this time.
0 commit comments