-
Notifications
You must be signed in to change notification settings - Fork 2
86 lines (75 loc) · 2.72 KB
/
Copy pathsnapshot.yml
File metadata and controls
86 lines (75 loc) · 2.72 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
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
---
name: Run Test Build
permissions:
contents: read
packages: write
statuses: write
checks: write
on:
push:
branches:
- main
pull_request:
jobs:
test-build:
runs-on: ubuntu-latest
permissions:
actions: read
contents: read
packages: write
statuses: write
checks: write
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
java-version: "17"
distribution: "temurin"
cache: "maven"
gpg-private-key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }}
gpg-passphrase: MAVEN_GPG_PASSPHRASE
- name: Build with Maven
run: mvn -B package --file pom.xml
env:
MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }}
- name: Test Summary
id: test_summary
uses: test-summary/action@v2
with:
paths: |
target/surefire-reports/TEST-*.xml
target/surefire-reports/**/TEST-*.xml
if: always()
- uses: qltysh/qlty-action/coverage@main
if: github.event_name != 'pull_request'
with:
coverage-token: ${{secrets.QLTY_COVERAGE_TOKEN}}
files: target/site/jacoco/jacoco.xml
# generates coverage-report.md and publishes as checkrun
- name: JaCoCo Code Coverage Report
id: jacoco_reporter
uses: PavanMudigonda/jacoco-reporter@v5.1
with:
coverage_results_path: target/site/jacoco/jacoco.xml
coverage_report_name: Coverage
coverage_report_title: JaCoCo
github_token: ${{ secrets.GITHUB_TOKEN }}
skip_check_run: false
minimum_coverage: 60
fail_below_threshold: false
publish_only_summary: false
# Publish Coverage Job Summary
- name: Add Jacoco report to workflow run summary
run: |
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: Publish package to GitHub Packages
if: github.event_name != 'pull_request'
run: mvn deploy -P github -DskipTests=true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }}