-
Notifications
You must be signed in to change notification settings - Fork 0
84 lines (70 loc) · 2.52 KB
/
coverage.yaml
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
name: Coverage
on:
push:
branches:
- master
jobs:
coverage_report:
runs-on: ubuntu-latest
steps:
- name: Get repo
uses: actions/checkout@v3
- name: Set up JDK 11
uses: actions/setup-java@v3
with:
java-version: 11
distribution: 'adopt'
- name: Build with Maven
run: mvn --batch-mode --update-snapshots package '-Dmaven.test.skip'
- name: Run JUnit Tests with Jacoco coverage
run: mvn --batch-mode '-Dasserts.enable=false' test jacoco:report
- name: Aggregate Reports from Sub Modules
run: |
mkdir coverage
mv jgalgo-core/target/site/jacoco coverage/jgalgo-core
mv jgalgo-io/target/site/jacoco coverage/jgalgo-io
mv jgalgo-example/target/site/jacoco coverage/jgalgo-example
mv jgalgo-bench/target/site/jacoco coverage/jgalgo-bench
- name: Generate JaCoCo Badge
uses: cicirello/jacoco-badge-generator@v2
with:
jacoco-csv-file: >
coverage/jgalgo-core/jacoco.csv
coverage/jgalgo-io/jacoco.csv
generate-coverage-badge: true
badges-directory: coverage/badges
- name: Zip coverage artifacts
run: |
mkdir artifacts/
tar -czf artifacts/jgalgo-core.tar.gz coverage/jgalgo-core/
tar -czf artifacts/jgalgo-io.tar.gz coverage/jgalgo-io/
tar -czf artifacts/jgalgo-example.tar.gz coverage/jgalgo-example/
tar -czf artifacts/jgalgo-bench.tar.gz coverage/jgalgo-bench/
- name: Upload jgalgo-core artifacts
uses: actions/upload-artifact@v3
with:
name: jgalgo-core-jacoco-coverage-report
path: artifacts/jgalgo-core.tar.gz
- name: Upload jgalgo-io artifacts
uses: actions/upload-artifact@v3
with:
name: jgalgo-io-jacoco-coverage-report
path: artifacts/jgalgo-io.tar.gz
- name: Upload jgalgo-example artifacts
uses: actions/upload-artifact@v3
with:
name: jgalgo-example-jacoco-coverage-report
path: artifacts/jgalgo-example.tar.gz
- name: Upload jgalgo-bench artifacts
uses: actions/upload-artifact@v3
with:
name: jgalgo-bench-jacoco-coverage-report
path: artifacts/jgalgo-bench.tar.gz
- name: Publish Jacoco Coverage Report
uses: JamesIves/github-pages-deploy-action@v4.4.1
with:
token: ${{ secrets.GITHUB_TOKEN }}
branch: coverage
clean: true
folder: coverage
target-folder: .