-
Notifications
You must be signed in to change notification settings - Fork 35
239 lines (233 loc) · 6.73 KB
/
validate.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
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
#
# Copyright (c) 2023, 2024 Oracle and/or its affiliates.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
name: "Validate"
on:
pull_request:
push:
workflow_call:
inputs:
ref:
description: The branch, tag or SHA to checkout
required: false
type: string
default: ''
env:
JAVA_VERSION: 17
JAVA_DISTRO: oracle
GRAALVM_VERSION: 21.3.3.1
MAVEN_ARGS: |
-B -fae -e
-Dmaven.wagon.httpconnectionManager.ttlSeconds=60
-Dmaven.wagon.http.retryHandler.count=3
-Djdk.toolchain.version=${JAVA_VERSION}
-Dcache.enabled=true
concurrency:
group: "${{ github.workflow }}-${{ github.ref }}"
cancel-in-progress: true
jobs:
copyright:
timeout-minutes: 5
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v4
with:
ref: ${{ inputs.ref }}
fetch-depth: 0
- uses: ./.github/actions/common
with:
run: etc/scripts/copyright.sh
checkstyle:
timeout-minutes: 5
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v4
with:
ref: ${{ inputs.ref }}
- uses: ./.github/actions/common
with:
run: etc/scripts/checkstyle.sh
shellcheck:
timeout-minutes: 5
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v4
with:
ref: ${{ inputs.ref }}
- uses: ./.github/actions/common
with:
maven-cache: none
run: etc/scripts/shellcheck.sh
build:
timeout-minutes: 15
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v4
with:
ref: ${{ inputs.ref }}
- id: build
uses: ./.github/actions/common
with:
build-cache: read-write
maven-cache: read-write
artifact-name: helidon-cli-dist
artifact-path: cli/impl/target/helidon-cli.zip
run: |
mvn --version
mvn ${MAVEN_ARGS} build-cache:go-offline
mvn ${MAVEN_ARGS} -T8 \
-Dorg.slf4j.simpleLogger.showThreadName=true \
-DskipTests \
-P tests \
install
tests:
needs: build
timeout-minutes: 15
strategy:
matrix:
os: [ ubuntu-20.04, windows-2022 ]
moduleSet: [ cli, cli-functional, archetype, linker, others ]
include:
- { os: ubuntu-20.04, platform: linux }
- { os: windows-2022, platform: windows }
runs-on: ${{ matrix.os }}
name: tests/${{ matrix.moduleSet }}-${{ matrix.platform }}
steps:
- uses: actions/checkout@v4
with:
ref: ${{ inputs.ref }}
- uses: ./.github/actions/common
with:
build-cache: read-only
test-artifact-name: tests-${{ matrix.moduleSet }}
run: |
mvn ${MAVEN_ARGS} \
-DreactorRule=tests \
-DmoduleSet=${{ matrix.moduleSet }} \
-Dsurefire.reportNameSuffix=${{ matrix.platform }} \
verify
spotbugs:
needs: build
timeout-minutes: 15
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v4
with:
ref: ${{ inputs.ref }}
- uses: ./.github/actions/common
with:
build-cache: read-only
run: |
mvn ${MAVEN_ARGS} -T 8 \
-DskipTests \
-Pspotbugs,build-cache \
verify
javadoc:
needs: build
timeout-minutes: 15
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v4
with:
ref: ${{ inputs.ref }}
- uses: ./.github/actions/common
with:
build-cache: read-only
run: |
mvn ${MAVEN_ARGS} -T 8 \
-DskipTests \
-Pjavadoc,build-cache \
package
vscode-ext:
needs: build
timeout-minutes: 15
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v4
with:
ref: ${{ inputs.ref }}
- uses: ./.github/actions/common
with:
build-cache: read-write
run: |
mvn ${MAVEN_ARGS} \
-pl ide-support/vscode-extension \
-DskipTests \
-P vscode \
install
cli:
needs: build
timeout-minutes: 15
strategy:
matrix:
os: [ ubuntu-20.04, windows-2022, macos-12 ]
include:
- { os: ubuntu-20.04, platform: linux-amd64 }
- { os: windows-2022, platform: windows-amd64, file-ext: .exe }
- { os: macos-12, platform: darwin-amd64 }
runs-on: ${{ matrix.os }}
name: cli/${{ matrix.platform }}
steps:
- uses: actions/checkout@v4
with:
ref: ${{ inputs.ref }}
- uses: ./.github/actions/common
with:
build-cache: read-only
native-image: true
test-artifact-name: helidon-cli-smoketest-${{ matrix.platform }}
artifact-name: helidon-cli-bin-${{ matrix.platform }}
artifact-path: cli/impl/target/helidon-cli-${{ matrix.platform }}${{ matrix.file-ext }}
run: |
# build the executable
mvn ${MAVEN_ARGS} \
-pl cli/impl \
-DskipTests \
-Pnative-image,!toolchain \
-Dnative.image.name=helidon-cli-${{ matrix.platform }} \
package
# smoke test
mvn ${MAVEN_ARGS} \
-pl cli/tests/functional \
-Pnative-image \
-Dnative.image.name=helidon-cli-${{ matrix.platform }} \
-Dsurefire.reportNameSuffix=native-image-${{ matrix.platform }} \
-Dtest=CliFunctionalV2Test#*Native* \
-P tests \
test
cli-binaries:
runs-on: ubuntu-20.04
needs: [ build, cli ]
name: cli/binaries
steps:
- uses: actions/upload-artifact/merge@v4
with:
name: helidon-cli
pattern: "helidon-cli-{bin-*,dist}"
test-results:
runs-on: ubuntu-20.04
needs: [ tests, cli ]
name: tests/results
steps:
- uses: actions/upload-artifact/merge@v4
with:
name: test-results
pattern: "*test*"
gate:
runs-on: ubuntu-20.04
needs: [ copyright, checkstyle, shellcheck, spotbugs, javadoc, vscode-ext, cli-binaries, test-results ]
steps:
- shell: bash
run: |
echo OK