blob: fc48669426ccd849e782677995340e6673857699 [file] [log] [blame]
#
# 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.
#
name: develop
on:
push:
branches: [ "develop" ]
pull_request:
branches: [ "develop" ]
permissions:
contents: read
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up JDK 8
uses: actions/setup-java@v3
with:
java-version: '8'
distribution: 'liberica'
- name: Run 'build install javadoc spotlessCheck rat checkPom resolveDependencies pmdMain' with Gradle
uses: gradle/gradle-build-action@v2
with:
arguments: --console=plain --no-daemon build install javadoc spotlessCheck rat checkPom resolveDependencies pmdMain -x test
apiCheck:
needs: build
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
distribution: [ 'liberica' ]
java: ['11']
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- name: Set up JDK (include all 3 JDKs in the env)
uses: actions/setup-java@v3
with:
distribution: ${{ matrix.distribution }}
java-version: |
8
11
17
- name: Set JAVA_TEST_PATH to 11
run: |
echo "JAVA_TEST_PATH=${JAVA_HOME_11_X64}" >> $GITHUB_ENV
if: matrix.java == '11'
- name: Java API Check
run: |
GRADLE_JVM_PATH=${JAVA_HOME_8_X64}
JAVA_BUILD_PATH=${JAVA_HOME_8_X64}
JAVA_BUILD_VERSION=8 # Use jdk 8 for build
JAVA_TEST_VERSION=${{ matrix.java }}
cp gradlew gradlewStrict
sed -e 's/JAVA_HOME/GRADLE_JVM/g' -i.back gradlewStrict
GRADLE_JVM=${GRADLE_JVM_PATH} JAVA_TEST_PATH=${JAVA_TEST_PATH} ./gradlewStrict \
-PcompileJVM=${JAVA_BUILD_PATH} \
-PcompileJVMVer=${JAVA_BUILD_VERSION} \
-PtestJVM=${JAVA_TEST_PATH} \
-PtestJVMVer=${JAVA_TEST_VERSION} \
-PtestJava8Home=${JAVA_HOME_8_X64} \
-PtestJava11Home=${JAVA_HOME_11_X64} \
-PtestJava17Home=${JAVA_HOME_17_X64} \
japicmp --console=plain --no-daemon
unitTest:
needs: build
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
distribution: ['liberica']
java: ['8', '11', '17']
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- name: Set up JDK (include all 3 JDKs in env)
uses: actions/setup-java@v3
with:
distribution: ${{ matrix.distribution }}
java-version: |
8
11
17
- name: Setup Gradle
uses: gradle/gradle-build-action@v2
- name: Set JAVA_TEST_PATH to 8
run: |
echo "JAVA_TEST_PATH=${JAVA_HOME_8_X64}" >> $GITHUB_ENV
if: matrix.java == '8'
- name: Set JAVA_TEST_PATH to 11
run: |
echo "JAVA_TEST_PATH=${JAVA_HOME_11_X64}" >> $GITHUB_ENV
if: matrix.java == '11'
- name: Set JAVA_TEST_PATH to 17
run: |
echo "JAVA_TEST_PATH=${JAVA_HOME_17_X64}" >> $GITHUB_ENV
if: matrix.java == '17'
- name: Run unit tests
run: |
GRADLE_JVM_PATH=${JAVA_HOME_8_X64}
JAVA_BUILD_PATH=${JAVA_HOME_8_X64}
JAVA_BUILD_VERSION=8 # Use jdk 8 for build
JAVA_TEST_VERSION=${{ matrix.java }}
cp gradlew gradlewStrict
sed -e 's/JAVA_HOME/GRADLE_JVM/g' -i.back gradlewStrict
GRADLE_JVM=${GRADLE_JVM_PATH} JAVA_TEST_PATH=${JAVA_TEST_PATH} ./gradlewStrict \
-PcompileJVM=${JAVA_BUILD_PATH} \
-PcompileJVMVer=${JAVA_BUILD_VERSION} \
-PtestJVM=${JAVA_TEST_PATH} \
-PtestJVMVer=${JAVA_TEST_VERSION} \
-PtestJava8Home=${JAVA_HOME_8_X64} \
-PtestJava11Home=${JAVA_HOME_11_X64} \
-PtestJava17Home=${JAVA_HOME_17_X64} \
test --console=plain --no-daemon
- uses: actions/upload-artifact@v3
if: failure()
with:
name: unit-test-reports-${{ matrix.os }}-${{ matrix.java }}
path: build/reports
retention-days: 5
integrationTest:
needs: [apiCheck, unitTest]
strategy:
matrix:
os: [ubuntu-latest]
distribution: ['liberica']
java: ['8']
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- name: Set up JDK
uses: actions/setup-java@v3
with:
distribution: ${{ matrix.distribution }}
java-version: |
8
11
17
- name: Setup Gradle
uses: gradle/gradle-build-action@v2
- name: Run integration tests
run: |
GRADLE_JVM_PATH=${JAVA_HOME_8_X64}
JAVA_BUILD_PATH=${JAVA_HOME_8_X64}
JAVA_BUILD_VERSION=8
JAVA_TEST_VERSION=${{ matrix.java }}
cp gradlew gradlewStrict
sed -e 's/JAVA_HOME/GRADLE_JVM/g' -i.back gradlewStrict
GRADLE_JVM=${GRADLE_JVM_PATH} JAVA_TEST_PATH=${JAVA_TEST_PATH} ./gradlewStrict \
--no-parallel \
--max-workers=12 \
-PcompileJVM=${JAVA_BUILD_PATH} \
-PcompileJVMVer=${JAVA_BUILD_VERSION} \
-PtestJVM=${JAVA_TEST_PATH} \
-PtestJVMVer=${JAVA_TEST_VERSION} \
-PtestJava8Home=${JAVA_HOME_8_X64} \
-PtestJava11Home=${JAVA_HOME_11_X64} \
-PtestJava17Home=${JAVA_HOME_17_X64} \
integrationTest --console=plain --no-daemon
- uses: actions/upload-artifact@v3
if: failure()
with:
name: integration-test-reports-${{ matrix.os }}-${{ matrix.java }}
path: build/reports
retention-days: 5
acceptanceTest:
needs: [apiCheck, unitTest]
strategy:
matrix:
os: [ubuntu-latest]
distribution: ['liberica']
java: ['8']
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- name: Set up JDK
uses: actions/setup-java@v3
with:
distribution: ${{ matrix.distribution }}
java-version: ${{ matrix.java }}
- name: Setup Gradle
uses: gradle/gradle-build-action@v2
- name: Run acceptance tests
run: |
GRADLE_JVM_PATH=${JAVA_HOME_8_X64}
JAVA_BUILD_PATH=${JAVA_HOME_8_X64}
JAVA_BUILD_VERSION=8
JAVA_TEST_VERSION=8
cp gradlew gradlewStrict
sed -e 's/JAVA_HOME/GRADLE_JVM/g' -i.back gradlewStrict
GRADLE_JVM=${GRADLE_JVM_PATH} JAVA_TEST_PATH=${JAVA_TEST_PATH} ./gradlewStrict \
--no-parallel \
-PcompileJVM=${JAVA_BUILD_PATH} \
-PcompileJVMVer=${JAVA_BUILD_VERSION} \
-PtestJVM=${JAVA_TEST_PATH} \
-PtestJVMVer=${JAVA_TEST_VERSION} \
-PtestJava8Home=${JAVA_HOME_8_X64} \
acceptanceTest --console=plain --no-daemon
- uses: actions/upload-artifact@v3
if: failure()
with:
name: acceptance-test-reports-${{ matrix.os }}-${{ matrix.java }}
path: build/reports
retention-days: 5