Skip to content

Commit 3bdbd9c

Browse files
committed
GitHub action validations added
Signed-off-by: Maxim Nesen <maxim.nesen@oracle.com>
1 parent 63c2ed4 commit 3bdbd9c

File tree

8 files changed

+129
-7
lines changed

8 files changed

+129
-7
lines changed

.github/workflows/maven.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#
2-
# Copyright (c) 2022, 2023 Contributors to the Eclipse Foundation
2+
# Copyright (c) 2022, 2024 Contributors to the Eclipse Foundation
33
#
44
# This program and the accompanying materials are made available under the
55
# terms of the Eclipse Public License v. 2.0 which is available at
@@ -10,7 +10,7 @@
1010
# SPDX-License-Identifier: EPL-2.0 OR BSD-3-Clause
1111
#
1212

13-
name: Jersey
13+
name: Eclipse Required License Check
1414

1515
on: [push, pull_request]
1616

@@ -29,11 +29,11 @@ jobs:
2929

3030
steps:
3131
- name: Checkout for build
32-
uses: actions/checkout@v3
32+
uses: actions/checkout@v4
3333
with:
3434
fetch-depth: 0
3535
- name: Set up JDK
36-
uses: actions/setup-java@v3
36+
uses: actions/setup-java@v4.1.0
3737
with:
3838
distribution: 'zulu'
3939
java-version: ${{ matrix.java_version }}
@@ -44,7 +44,7 @@ jobs:
4444
- name: Build
4545
run: mvn -V -U -B ${{matrix.verify_profiles}} org.eclipse.dash:license-tool-plugin:license-check -DexcludeArtifactIds=bsh,jmh-core,jmh-generator-annprocess,swing-layout
4646
- name: Upload license-check info
47-
uses: actions/upload-artifact@v3
47+
uses: actions/upload-artifact@v4
4848
with:
4949
name: license-summary.txt
5050
path: target/dash/summary

.github/workflows/validate.yml

Lines changed: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
1+
#
2+
# Copyright (c) 2024 Contributors to the Eclipse Foundation
3+
#
4+
# This program and the accompanying materials are made available under the
5+
# terms of the Eclipse Public License v. 2.0 which is available at
6+
# http://www.eclipse.org/legal/epl-2.0,
7+
# or the Eclipse Distribution License v. 1.0 which is available at
8+
# http://www.eclipse.org/org/documents/edl-v10.php.
9+
#
10+
# SPDX-License-Identifier: EPL-2.0 OR BSD-3-Clause
11+
#
12+
13+
name: "Validate"
14+
15+
on: [pull_request, push]
16+
17+
env:
18+
JAVA_VERSION: '8'
19+
JAVA_DISTRO: 'temurin'
20+
21+
concurrency:
22+
group: ${{ github.workflow }}-${{ github.ref }}
23+
cancel-in-progress: true
24+
25+
jobs:
26+
copyright:
27+
timeout-minutes: 10
28+
runs-on: ubuntu-latest
29+
steps:
30+
- uses: actions/checkout@v4
31+
with:
32+
fetch-depth: 0
33+
- name: Set up JDK ${{ env.JAVA_VERSION }}
34+
uses: actions/setup-java@v4.1.0
35+
with:
36+
distribution: ${{ env.JAVA_DISTRO }}
37+
java-version: ${{ env.JAVA_VERSION }}
38+
cache: maven
39+
- name: Copyright
40+
run: etc/scripts/copyright.sh
41+
- name: Upload copyright info
42+
uses: actions/upload-artifact@v4
43+
with:
44+
name: copyright_results
45+
path: copyright.log
46+
retention-days: 5
47+
checkstyle:
48+
timeout-minutes: 10
49+
runs-on: ubuntu-latest
50+
steps:
51+
- uses: actions/checkout@v4
52+
- name: Set up JDK ${{ env.JAVA_VERSION }}
53+
uses: actions/setup-java@v4.1.0
54+
with:
55+
distribution: ${{ env.JAVA_DISTRO }}
56+
java-version: ${{ env.JAVA_VERSION }}
57+
cache: maven
58+
- name: Checkstyle
59+
run: etc/scripts/checkstyle.sh
60+
- name: Upload checkstyle info
61+
uses: actions/upload-artifact@v4
62+
with:
63+
name: checkstyle_results
64+
path: target/checkstyle/checkstyle-result.xml
65+
retention-days: 5
66+
apidocs:
67+
timeout-minutes: 30
68+
runs-on: ubuntu-latest
69+
steps:
70+
- uses: actions/checkout@v4
71+
- name: Set up JDK 17
72+
uses: actions/setup-java@v4.1.0
73+
with:
74+
distribution: ${{ env.JAVA_DISTRO }}
75+
java-version: 17
76+
cache: maven
77+
- name: Build JDK17+ required modules
78+
run: mvn -B -U -V clean install -DskipTests -pl :jersey-helidon-connector -am
79+
- name: Set up JDK ${{ env.JAVA_VERSION }}
80+
uses: actions/setup-java@v4.1.0
81+
with:
82+
distribution: ${{ env.JAVA_DISTRO }}
83+
java-version: ${{ env.JAVA_VERSION }}
84+
cache: maven
85+
- name: Build ApiDocs
86+
run: etc/scripts/apidocs.sh
87+
archetypes:
88+
timeout-minutes: 45
89+
runs-on: ubuntu-latest
90+
steps:
91+
- uses: actions/checkout@v4
92+
- name: Set up JDK ${{ env.JAVA_VERSION }}
93+
uses: actions/setup-java@v4.1.0
94+
with:
95+
distribution: ${{ env.JAVA_DISTRO }}
96+
java-version: ${{ env.JAVA_VERSION }}
97+
cache: maven
98+
- name: Test archetypes
99+
run: etc/scripts/test-archetypes.sh

etc/config/checkstyle.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<!--
33
4-
Copyright (c) 2010, 2020 Oracle and/or its affiliates. All rights reserved.
4+
Copyright (c) 2010, 2024 Oracle and/or its affiliates. All rights reserved.
55
66
This program and the accompanying materials are made available under the
77
terms of the Eclipse Public License v. 2.0, which is available at
@@ -88,7 +88,7 @@
8888
<!-- Checks for Javadoc comments. -->
8989
<!-- See http://checkstyle.sf.net/config_javadoc.html -->
9090
<module name="JavadocMethod">
91-
<property name="scope" value="protected"/>
91+
<property name="accessModifiers" value="protected"/>
9292
<!-- <property name="allowUndeclaredRTE" value="true"/>-->
9393
</module>
9494
<module name="JavadocType">

etc/config/copyright-exclude

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ jaxb.index
4141
/etc/config/copyright.txt
4242
/etc/config/edl-copyright.txt
4343
/etc/jenkins/
44+
/etc/scripts
4445
/etc/travis/
4546
/LICENSE.md
4647
/third-party-license-readme.txt

etc/scripts/apidocs.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#!/bin/bash
2+
3+
mvn -U -V -B clean install -Ppre-release -pl :apidocs -am -DskipTests

etc/scripts/checkstyle.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#!/bin/bash
2+
3+
mvn -V -U -B checkstyle:checkstyle-aggregate -Dcheckstyle.output.format="plain" -Dcheckstyle.output.file=checkstyle.log

etc/scripts/copyright.sh

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#!/bin/bash
2+
3+
readonly CP_PATTERN='Copyright year is wrong'
4+
5+
6+
[[ -n ${1} ]] && readonly LOG_FILE=${1} || readonly LOG_FILE='copyright.log'
7+
8+
9+
echo ${LOG_FILE}
10+
11+
mvn -U -B glassfish-copyright:copyright -Dcopyright.quiet=false | grep "${CP_PATTERN}" | tee ${LOG_FILE}
12+
13+
grep "${CP_PATTERN}" ${LOG_FILE} || exit 0 && exit 1

etc/scripts/test-archetypes.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#!/bin/bash
2+
3+
mvn -U -V -B clean install -pl org.glassfish.jersey.archetypes:project

0 commit comments

Comments
 (0)