Skip to content

Commit

Permalink
Merge pull request #556 from TheSnoozer/fix-tests-java16
Browse files Browse the repository at this point in the history
Fix tests for java16+add java17-ea to the test matrix and update dependencies
  • Loading branch information
TheSnoozer committed Jun 8, 2021
2 parents 4a1ac8f + 70c6b01 commit 7b66821
Show file tree
Hide file tree
Showing 2 changed files with 57 additions and 21 deletions.
56 changes: 38 additions & 18 deletions .github/workflows/default-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,15 @@ jobs:
name: Run checkstyle
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v2
- name: Set up JDK 8
uses: actions/setup-java@v1
uses: actions/setup-java@v2
with:
distribution: 'zulu'
java-version: 8
java-package: jdk
- name: Cache local Maven repository
uses: actions/cache@v1
uses: actions/cache@v2
with:
path: ~/.m2
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
Expand All @@ -27,22 +29,34 @@ jobs:
needs: checkstyle
strategy:
matrix:
java_version: ['8', '9', '10', '11', '12', '13', '14', '15', '16']
java_allow_illegal_access: [false]
java_version: ['8', '9', '10', '11', '12', '13', '14', '15']
include:
- java_version: '16'
java_allow_illegal_access: true
- java_version: '17-ea'
java_allow_illegal_access: true

steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v2
- name: Set up JDK ${{ matrix.java_version }}
uses: actions/setup-java@v1
uses: actions/setup-java@v2
with:
distribution: 'zulu'
java-version: ${{ matrix.java_version }}
java-package: jdk
- name: Cache local Maven repository
uses: actions/cache@v1
uses: actions/cache@v2
with:
path: ~/.m2
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
restore-keys: ${{ runner.os }}-m2
- name: Build with Maven
- name: Build with Maven (no illegal access allowed)
if: ${{ ! matrix.java_allow_illegal_access }}
run: mvn clean verify javadoc:javadoc -B
- name: Build with Maven (illegal access allowed)
if: ${{ matrix.java_allow_illegal_access }}
run: mvn clean verify javadoc:javadoc -Pjava-allow-illegal-access -B

integration-test:
name: Run integration test with Java ${{ matrix.java_version }} and Maven ${{ matrix.maven_version }}
Expand All @@ -51,14 +65,16 @@ jobs:
strategy:
matrix:
java_version: ['8']
maven_version: ['3.0', '3.0.5', '3.1.1', '3.2.5', '3.3.9', '3.5.4', '3.6.3']
maven_version: ['3.0', '3.0.5', '3.1.1', '3.2.5', '3.3.9', '3.5.4', '3.6.3', '3.8.1']

steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v2
- name: Set up JDK ${{ matrix.java_version }}
uses: actions/setup-java@v1
uses: actions/setup-java@v2
with:
distribution: 'zulu'
java-version: ${{ matrix.java_version }}
java-package: jdk
- name: Setup Maven ${{ matrix.maven_version }}
run: /bin/bash -c 'if [[ -n "${{ matrix.maven_version }}" ]]; then \
echo "Downloading Maven ${{ matrix.maven_version }}....";
Expand All @@ -77,7 +93,7 @@ jobs:
- name: Setup System Path to use the custom Maven
run: echo "${M2_HOME}/bin" >> $GITHUB_PATH
- name: Cache local Maven repository
uses: actions/cache@v1
uses: actions/cache@v2
with:
path: ~/.m2
# Include Maven version in key to not use cache from other Maven versions
Expand All @@ -101,14 +117,16 @@ jobs:
if: ${{ github.event_name != 'pull_request' && (startsWith(github.ref, 'refs/tags/') || github.ref == 'refs/heads/master') }}

steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v2
- run: git checkout "${GITHUB_REF:11}"
- name: Set up JDK 8
uses: actions/setup-java@v1
uses: actions/setup-java@v2
with:
distribution: 'zulu'
java-version: 8
java-package: jdk
- name: Cache local Maven repository
uses: actions/cache@v1
uses: actions/cache@v2
with:
path: ~/.m2
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
Expand All @@ -123,13 +141,15 @@ jobs:
if: ${{ github.event_name != 'pull_request' && !startsWith(github.ref, 'refs/tags/') && github.ref == 'refs/heads/master' }}

steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v2
- name: Set up JDK 8
uses: actions/setup-java@v1
uses: actions/setup-java@v2
with:
distribution: 'zulu'
java-version: 8
java-package: jdk
- name: Cache local Maven repository
uses: actions/cache@v1
uses: actions/cache@v2
with:
path: ~/.m2
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
Expand Down
22 changes: 19 additions & 3 deletions maven/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@
<maven-plugin-plugin.version>3.6.0</maven-plugin-plugin.version>

<junit.version>4.13.2</junit.version>
<mockito.version>3.1.0</mockito.version>
<mockito.version>3.11.0</mockito.version>

<assertj.version>3.14.0</assertj.version>
<assertj.version>3.19.0</assertj.version>
</properties>

<dependencies>
Expand Down Expand Up @@ -101,7 +101,7 @@
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<version>2.8.0</version>
<version>2.9.0</version>
<type>jar</type>
<scope>test</scope>
</dependency>
Expand Down Expand Up @@ -195,6 +195,22 @@
</build>

<profiles>
<profile>
<id>java-allow-illegal-access</id>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<trimStackTrace>false</trimStackTrace>
<!-- Workaround for https://github.com/stefanbirkner/system-lambda/issues/23 -->
<argLine>--illegal-access=permit</argLine>
</configuration>
</plugin>
</plugins>
</build>
</profile>
<profile>
<id>gpg</id>
<build>
Expand Down

0 comments on commit 7b66821

Please sign in to comment.