-
Notifications
You must be signed in to change notification settings - Fork 0
91 lines (77 loc) · 2.24 KB
/
ci.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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
name: Continuous Integration process
run-name: ${{ github.actor }} has launched CI process on ${{ github.ref_name }}
on:
push:
branches:
- "main"
- "develop"
pull_request:
branches:
- "main"
- "develop"
permissions:
contents: read
issues: read
checks: write
pull-requests: write
jobs:
Continuous-Integration-Actions:
runs-on: self-hosted
env:
PACKAGE_TOKEN: ${{ secrets.JLS_TOKEN }}
steps:
- name: Checkout of head
id: ci-sources-checkout
uses: actions/checkout@v4
- name: Set up JDK 21
id: ci-java-setup
uses: actions/setup-java@v4
with:
java-version: 21
distribution: 'temurin'
- name: Gradle build
id: ci-gradle-build
run: ./gradlew clean assemble
- name: Gradle tests
run: ./gradlew test
- name: Run Coverage
run: ./gradlew jacocoTestReport
- name: Add coverage to PR
id: jacoco
uses: madrapps/[email protected]
with:
paths: |
**/build/reports/jacoco/test/jacocoTestReport.xml
token: ${{ secrets.GITHUB_TOKEN }}
min-coverage-overall: 40
min-coverage-changed-files: 60
update-comment: true
- name: Get the Coverage info
run: |
echo "Total coverage ${{ steps.jacoco.outputs.coverage-overall }}"
echo "Changed Files coverage ${{ steps.jacoco.outputs.coverage-changed-files }}"
- name: Upload Coverage Report
uses: actions/upload-artifact@v3
with:
name: coverage-report
path: build/reports/jacoco/test/html
- name: Publish Test Results
uses: EnricoMi/publish-unit-test-result-action/linux@v2
if: always()
with:
files: |
build/test-results/**/*.xml
- name: Get test artifacts
if: ${{ failure() }}
uses: actions/upload-artifact@v4
with:
name: Package
path: |
**/build/reports/
**/build/test-results/
- name: Final Step
id: ci-final-step
run: |
echo "This job's status is ${{ job.status }}."
echo "Created jar file(s):"
find ./build -name '*.jar'