-
Notifications
You must be signed in to change notification settings - Fork 0
110 lines (93 loc) · 2.95 KB
/
ci-pr.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
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
# This workflow will build a Quarkus project with Maven
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven
name: 👷 Pull Request CI pipeline 👷
# This section allows the workflow to create a Release
# https://github.com/softprops/action-gh-release/issues/236#issuecomment-1150530128
permissions:
checks: write
contents: write
pull-requests: write
# This section ensures that new pushes cancel current executions of the workflow
concurrency:
group: ${{ github.ref }}
cancel-in-progress: true
# Enabled manual triggering as this repo does not include a Quarkus/Maven repository
# Comment to disable manual triggering
on: workflow_dispatch
# Uncomment following lines to enable this workflow in a Quarkus/Maven repository
#on:
# pull_request:
# branches:
# - main
# paths-ignore:
# - 'argocd/**'
# - 'img/**'
# - 'LICENSE'
# - '*.md'
env:
JAVA_VERSION: "17"
jobs:
setup:
runs-on: ubuntu-latest
name: Get Application Version
outputs:
app_version: ${{ steps.get_app_version.outputs.version }}
steps:
- name: Checkout the code
uses: actions/checkout@v3
- name: Set up JDK
uses: actions/setup-java@v3
with:
java-version: ${{ env.JAVA_VERSION }}
distribution: 'adopt'
- name: Get version from Maven project
id: get_app_version
run: |
APP_VERSION=$(./mvnw help:evaluate -Dexpression=project.version -q -DforceStdout)
echo "Application Version: $APP_VERSION"
echo "version=$APP_VERSION" >> $GITHUB_OUTPUT
build:
runs-on: ubuntu-latest
name: "Compile"
needs:
- setup
steps:
- name: Checkout the code
uses: actions/checkout@v3
- name: Set up JDK
uses: actions/setup-java@v3
with:
java-version: ${{ env.JAVA_VERSION }}
distribution: 'adopt'
- name: Build with Maven
run: |
echo "Building version ${{ needs.setup.outputs.app_version }}"
./mvnw -B package --file pom.xml
#- name: Official SonarQube Scan
# uses: SonarSource/[email protected]
- name: Publish Unit Test Results
uses: EnricoMi/publish-unit-test-result-action@v2
if: always()
with:
files: target/surefire-reports/**/*.xml
build-jvm:
runs-on: ubuntu-latest
needs:
- setup
- build
name: "Build Artifact"
steps:
- name: "Checkout the code"
uses: actions/checkout@v3
- name: Set up JDK
uses: actions/setup-java@v3
with:
java-version: ${{ env.JAVA_VERSION }}
distribution: 'adopt'
- name: "Build executable"
run: ./mvnw install --no-transfer-progress -DskipTests
- name: "Upload executable"
uses: actions/upload-artifact@v3
with:
name: executable
path: target/quarkus-app/*