-
Notifications
You must be signed in to change notification settings - Fork 0
68 lines (58 loc) · 2.55 KB
/
maven.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
name: Java CI with Maven
on: push
jobs:
build:
name: "Build and test"
runs-on: ubuntu-latest
permissions:
checks: write
env:
CI_BADGES_GIST: c098f5fa219b3aa17fd8dabf9087cc14
CI_BADGES_GIST_STAGING: b215880fcc3b1db343bccd1147ed9c06
steps:
- name: "Checkout repository"
uses: actions/checkout@v4
- name: "Set up JDK 21"
uses: actions/setup-java@v4
with:
java-version: '21'
distribution: 'temurin'
cache: maven
- name: "Build with Maven"
run: mvn verify --batch-mode --no-transfer-progress
- name: "JUnit test report"
uses: dorny/test-reporter@1a288b62f8b75c0f433cbfdbc2e4800fbae50bd7
if: ${{ !cancelled() }}
with:
name: JUnit Tests
path: target/surefire-reports/*.xml
reporter: java-junit
use-actions-summary: 'true'
- name: "JaCoCo code coverage report"
id: jacoco_reporter
uses: PavanMudigonda/jacoco-reporter@4fc6bf270fe893e8dda5467e432253a6961345b8
if: ${{ !cancelled() }}
with:
coverage_results_path: target/site/jacoco/jacoco.xml
coverage_report_name: Coverage
coverage_report_title: JaCoCo
skip_check_run: true
- name: "Add JaCoCo report to workflow run summary"
if: ${{ steps.jacoco_reporter.outputs.coverage_percentage != '' }}
run: |
echo "## Code Coverage" >> $GITHUB_STEP_SUMMARY
echo "| Outcome | Value |" >> $GITHUB_STEP_SUMMARY
echo "| --- | --- |" >> $GITHUB_STEP_SUMMARY
echo "| Code Coverage % | ${{ steps.jacoco_reporter.outputs.coverage_percentage }} |" >> $GITHUB_STEP_SUMMARY
echo "| :heavy_check_mark: Number of Lines Covered | ${{ steps.jacoco_reporter.outputs.covered_lines }} |" >> $GITHUB_STEP_SUMMARY
echo "| :x: Number of Lines Missed | ${{ steps.jacoco_reporter.outputs.missed_lines }} |" >> $GITHUB_STEP_SUMMARY
echo "| Total Number of Lines | ${{ steps.jacoco_reporter.outputs.total_lines }} |" >> $GITHUB_STEP_SUMMARY
- name: "Update CI badges"
uses: gaelgirodon/ci-badges-action@d4394e8ae1180779c579e768aea23a0e7b02c53a
env:
GIST_ID: ${{ github.event_name == 'push' && github.ref_name == 'main' && env.CI_BADGES_GIST || env.CI_BADGES_GIST_STAGING }}
with:
gist-id: ${{ env.GIST_ID }}
token: ${{ secrets.CI_BADGES_GIST_TOKEN }}
- name: "Purge camo cache"
uses: kevincobain2000/action-camo-purge@5169e719d6daf0fdbf8d2174f9438f919627aa87