-
Notifications
You must be signed in to change notification settings - Fork 13
62 lines (53 loc) · 1.73 KB
/
build-code.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
name: Build and verify source code
on:
workflow_call:
jobs:
build-image:
runs-on: ubuntu-latest
name: "Build and Verify"
steps:
- uses: project-ncl/sbomer/.github/actions/checkout@main
if: github.event_name == 'pull_request_target'
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
triggering-actor: ${{ github.triggering_actor }}
repo-ref: ${{ github.event.pull_request.head.ref }}
repo-full-name: ${{ github.event.pull_request.head.repo.full_name }}
- uses: actions/checkout@v4
if: github.event_name != 'pull_request_target'
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: "17"
distribution: "temurin"
cache: maven
- name: Build with Maven
run: mvn --batch-mode -V -U verify -Dsurefire.useFile=false jacoco:report
- name: Test Report
uses: dorny/test-reporter@v1
if: success() || failure()
with:
name: Test Results
path: "**/target/surefire-reports/**/*.xml"
reporter: java-junit
- name: Add coverage to PR
id: jacoco
uses: madrapps/[email protected]
with:
paths: |
${{ github.workspace }}/**/target/site/jacoco/jacoco.xml
token: ${{ secrets.GITHUB_TOKEN }}
min-coverage-overall: 40
min-coverage-changed-files: 60
- name: Upload Service
uses: actions/upload-artifact@v4
with:
name: dist-service
path: |
service/target/quarkus-app
- name: Upload CLI
uses: actions/upload-artifact@v4
with:
name: dist-cli
path: |
cli/target/quarkus-app