-
Notifications
You must be signed in to change notification settings - Fork 0
103 lines (87 loc) · 3.53 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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
name: Coverage
on:
push:
branches:
- master
jobs:
coverage_report:
runs-on: ubuntu-latest
steps:
- name: Get repo
uses: actions/checkout@v4
- name: Set up JDK 11
uses: actions/setup-java@v4
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 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-adapt-guava/target/site/jacoco coverage/jgalgo-adapt-guava
mv jgalgo-adapt-jgrapht/target/site/jacoco coverage/jgalgo-adapt-jgrapht
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
coverage/jgalgo-adapt-guava/jacoco.csv
coverage/jgalgo-adapt-jgrapht/jacoco.csv
coverage/jgalgo-example/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-adapt-guava.tar.gz coverage/jgalgo-adapt-guava/
tar -czf artifacts/jgalgo-adapt-jgrapht.tar.gz coverage/jgalgo-adapt-jgrapht/
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@v4
with:
name: jgalgo-core-jacoco-coverage-report
path: artifacts/jgalgo-core.tar.gz
- name: Upload jgalgo-io artifacts
uses: actions/upload-artifact@v4
with:
name: jgalgo-io-jacoco-coverage-report
path: artifacts/jgalgo-io.tar.gz
- name: Upload jgalgo-adapt-guava artifacts
uses: actions/upload-artifact@v4
with:
name: jgalgo-adapt-guava-jacoco-coverage-report
path: artifacts/jgalgo-adapt-guava.tar.gz
- name: Upload jgalgo-adapt-jgrapht artifacts
uses: actions/upload-artifact@v4
with:
name: jgalgo-adapt-jgrapht-jacoco-coverage-report
path: artifacts/jgalgo-adapt-jgrapht.tar.gz
- name: Upload jgalgo-example artifacts
uses: actions/upload-artifact@v4
with:
name: jgalgo-example-jacoco-coverage-report
path: artifacts/jgalgo-example.tar.gz
- name: Upload jgalgo-bench artifacts
uses: actions/upload-artifact@v4
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
with:
token: ${{ secrets.GITHUB_TOKEN }}
branch: coverage
clean: true
folder: coverage
target-folder: .