Skip to content

Commit 51bff4b

Browse files
committed
GitHub action validations added
Signed-off-by: Maxim Nesen <maxim.nesen@oracle.com>
1 parent 9602806 commit 51bff4b

File tree

8 files changed

+114
-5
lines changed

8 files changed

+114
-5
lines changed

.github/workflows/maven.yml

Lines changed: 3 additions & 3 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
@@ -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 }}

.github/workflows/validate.yml

Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
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: '1.8'
19+
JAVA_DISTRO: 'oracle'
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 copyright 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+
docs:
67+
timeout-minutes: 30
68+
runs-on: ubuntu-latest
69+
steps:
70+
- uses: actions/checkout@v4
71+
- name: Set up JDK ${{ env.JAVA_VERSION }}
72+
uses: actions/setup-java@v4.1.0
73+
with:
74+
distribution: ${{ env.JAVA_DISTRO }}
75+
java-version: ${{ env.JAVA_VERSION }}
76+
cache: maven
77+
- name: Docs
78+
run: etc/scripts/docs.sh
79+
archetypes:
80+
timeout-minutes: 45
81+
strategy:
82+
matrix:
83+
os: [ ubuntu-20.04 ]
84+
runs-on: ${{ matrix.os }}
85+
steps:
86+
- uses: actions/checkout@v4
87+
- name: Set up JDK ${{ env.JAVA_VERSION }}
88+
uses: actions/setup-java@v4.1.0
89+
with:
90+
distribution: ${{ env.JAVA_DISTRO }}
91+
java-version: ${{ env.JAVA_VERSION }}
92+
cache: maven
93+
- name: Test archetypes
94+
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/checkstyle.sh

Whitespace-only changes.

etc/scripts/copyright.sh

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

etc/scripts/docs.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

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)