Skip to content

Commit

Permalink
Merge pull request #131 from apache/support-newer-java-versions
Browse files Browse the repository at this point in the history
Support newer java versions
  • Loading branch information
davecromberge authored Jul 8, 2021
2 parents 58e1efe + eac2025 commit 413136b
Show file tree
Hide file tree
Showing 152 changed files with 2,906 additions and 340 deletions.
48 changes: 39 additions & 9 deletions .github/workflows/.toolchains.xml
Original file line number Diff line number Diff line change
@@ -1,20 +1,50 @@
<?xml version="1.0" encoding="UTF8"?>
<toolchains>
<toolchain>
<type>jdk</type>
<provides>
<version>1.8</version>
<vendor>openjdk</vendor>
</provides>
<configuration>
<jdkHome>${env.JAVA8_HOME}</jdkHome>
</configuration>
</toolchain>
<toolchain>
<type>jdk</type>
<provides>
<version>8</version>
<vendor>adoptopenjdk</vendor>
<vendor>openjdk</vendor>
</provides>
<configuration>
<jdkHome>${env.JAVA8_HOME}</jdkHome>
</configuration>
</toolchain>
<toolchain>
<type>jdk</type>
<provides>
<version>9</version>
<vendor>openjdk</vendor>
</provides>
<configuration>
<jdkHome>${env.JAVA9_HOME}</jdkHome>
</configuration>
</toolchain>
<toolchain>
<type>jdk</type>
<provides>
<version>10</version>
<vendor>openjdk</vendor>
</provides>
<configuration>
<jdkHome>${JAVA_HOME}</jdkHome>
<jdkHome>${env.JAVA10_HOME}</jdkHome>
</configuration>
</toolchain>
<toolchain>
<type>jdk</type>
<provides>
<version>11</version>
<vendor>adoptopenjdk</vendor>
<vendor>openjdk</vendor>
</provides>
<configuration>
<jdkHome>${env.JAVA11_HOME}</jdkHome>
Expand All @@ -23,21 +53,21 @@
<toolchain>
<type>jdk</type>
<provides>
<version>15</version>
<vendor>adoptopenjdk</vendor>
<version>12</version>
<vendor>openjdk</vendor>
</provides>
<configuration>
<jdkHome>${env.JAVA15_HOME}</jdkHome>
<jdkHome>${env.JAVA12_HOME}</jdkHome>
</configuration>
</toolchain>
<toolchain>
<type>jdk</type>
<provides>
<version>16</version>
<vendor>adoptopenjdk</vendor>
<version>13</version>
<vendor>openjdk</vendor>
</provides>
<configuration>
<jdkHome>${env.JAVA16_HOME}</jdkHome>
<jdkHome>${env.JAVA13_HOME}</jdkHome>
</configuration>
</toolchain>
</toolchains>
163 changes: 116 additions & 47 deletions .github/workflows/maven.yml
Original file line number Diff line number Diff line change
@@ -1,54 +1,123 @@
name: Java Test Coverage with Maven, Coveralls

on:
pull_request:
push:
branches: [ master ]
workflow_dispatch:
pull_request:
push:
branches: [ master ]
workflow_dispatch:

env:
MAVEN_OPTS: -Xmx4g -Xms1g
repo_token: ${{secrets.coveralls_token}}
MAVEN_OPTS: -Xmx4g -Xms1g
repo_token: ${{secrets.coveralls_token}}
RUNNER_TEMP: /tmp

jobs:
build:
name: Build, Test, Coverage
runs-on: ubuntu-latest

steps:
- name: "Checkout ${{ github.ref }} ( ${{ github.sha }} )"
uses: actions/checkout@v2
with:
persist-credentials: false

- name: Cache local Maven repository
uses: actions/cache@v2
with:
path: ~/.m2/repository
key: build-${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: build-${{ runner.os }}-maven-

- name: Install JDK
uses: AdoptOpenJDK/install-jdk@v1
with:
version: '8'
architecture: x64
impl: hotspot
targets: 'JDK_8;JAVA_HOME'

- name: Install Dependencies
run: >
mvn clean install -B -V -q
-DskipTests=true
-Dmaven.javadoc.skip=true
-Dgpg.skip=true
--toolchains .github/workflows/.toolchains.xml
- name: Test & Report
if: ${{ success() }}
run: >
mvn verify coveralls:report -B -V -q
-Dcoveralls-repo-token=${repo_token}
-Dmaven.javadoc.skip=true
-Dgpg.skip=true
--toolchains .github/workflows/.toolchains.xml
build:
name: Build, Test, Coverage
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
jdk: [8,9,10,11,12,13]

# All JDKs are installed per build machine which is inefficient

env:
JDK_VERSION: ${{ matrix.jdk }}

steps:
- name: "Checkout ${{ github.ref }} ( ${{ github.sha }} )"
uses: actions/checkout@v2
with:
persist-credentials: false

- name: Cache local Maven repository
uses: actions/cache@v2
with:
path: ~/.m2/repository
key: build-${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: build-${{ runner.os }}-maven-

- name: Install JDK 8
uses: AdoptOpenJDK/install-jdk@v1
with:
version: '8'
architecture: x64
impl: hotspot
targets: 'JAVA8_HOME'

- name: Install JDK 9
uses: AdoptOpenJDK/install-jdk@v1
with:
version: '9'
architecture: x64
impl: hotspot
targets: 'JAVA9_HOME'

- name: Install JDK 10
uses: AdoptOpenJDK/install-jdk@v1
with:
version: '10'
architecture: x64
impl: hotspot
targets: 'JAVA10_HOME'

- name: Install JDK 11
uses: AdoptOpenJDK/install-jdk@v1
with:
version: '11'
architecture: x64
impl: hotspot
targets: 'JAVA11_HOME'

- name: Install JDK 12
uses: AdoptOpenJDK/install-jdk@v1
with:
version: '12'
architecture: x64
impl: hotspot
targets: 'JAVA12_HOME'

- name: Install JDK 13
uses: AdoptOpenJDK/install-jdk@v1
with:
version: '13'
architecture: x64
impl: hotspot
targets: 'JAVA13_HOME'

- name: Install Matrix JDK
uses: AdoptOpenJDK/install-jdk@v1
with:
version: ${{ matrix.jdk }}
architecture: x64
impl: hotspot
targets: 'JAVA_HOME'

- name: Echo Java Version
run: >
java -version
- name: Install Dependencies
run: >
mvn clean install
-DskipTests=true
-Dmaven.javadoc.skip=true
-Dgpg.skip=true
--toolchains .github/workflows/.toolchains.xml
- name: Package
run: >
mvn package
-Dmaven.javadoc.skip=true
-Dgpg.skip=true
--toolchains .github/workflows/.toolchains.xml
- name: Test & Report
if: ${{ matrix.jdk == 8 && success() }}
run: >
mvn verify coveralls:report -B -V
-Dcoveralls-repo-token=${repo_token}
-Dmaven.javadoc.skip=true
-Dgpg.skip=true
--toolchains .github/workflows/.toolchains.xml
60 changes: 60 additions & 0 deletions .lgtm.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
##########################################################################################
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you 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.
##########################################################################################

#########################################################################################
# Use the extraction block to define changes to the default code extraction process #
# for one or more languages. The settings for each language are defined in a child #
# block, with one or more steps. #
#########################################################################################

extraction:

# Define settings for Java analysis
####################################
java:
# The `index` step extracts information from the files in the codebase.
index:
# Specify the Java version required to build the project.
java_version: 8
# Specify Maven settings.
maven:
# Specify the path of a Maven toolchains file.
# Default: Maven uses a toolchains file in the default location, if it exists.
toolchains_file: .github/workflows/.toolchains.xml

# Define settings for JavaScript analysis
##########################################
javascript:

# The `index` step extracts information from the files in the codebase.
index:
# Specify a list of files and folders to exclude from extraction.
exclude:
- **/*/site
# Specify a list of glob patterns to include/exclude files from extraction; this
# is applied on top of the include/exclude paths from above; patterns are
# processed in the same way as for path classifiers above.
# Default: include all files with known extensions (such as .js, .ts and .html),
# but exclude files ending in `-min.js` or `.min.js` and folders named `node_modules`
# or `bower_components`
filters:
# exclude any *.js files anywhere.
- exclude: "**/*.js"
# exclude any *.html files anywhere.
- exclude: "**/*.html"
Loading

0 comments on commit 413136b

Please sign in to comment.