-
Notifications
You must be signed in to change notification settings - Fork 0
49 lines (41 loc) · 1.02 KB
/
Copy pathtests.yml
File metadata and controls
49 lines (41 loc) · 1.02 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
name: tests
on:
workflow_dispatch:
branches:
- main
push:
branches: [ main ]
paths:
- 'src/**/*.java'
pull_request:
branches: [ main ]
paths:
- 'src/**/*.java'
jobs:
build:
runs-on: ubuntu-latest
name: Generate test coverage badge
steps:
- uses: actions/checkout@v2
- name: Set up the Java JDK
uses: actions/setup-java@v2
with:
java-version: 11
distribution: 'adopt'
- name: Test with Maven
run: mvn -B test
- name: Generate JaCoCo Badge
id: jacoco
uses: cicirello/jacoco-badge-generator@v2
with:
generate-branches-badge: true
- name: Log coverage percentage
run: |
echo "coverage = ${{ steps.jacoco.outputs.coverage }}"
echo "branch coverage = ${{ steps.jacoco.outputs.branches }}"
- name: Commit and push the badge (if it changed)
uses: EndBug/add-and-commit@v7
with:
default_author: github_actions
message: 'commit badge'
add: '*.svg'