Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,19 @@ jobs:

steps:

- name: Set up JDK
- name: Set up JDK for build and test
if: matrix.jdk != 17

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does JDK17 not support Gradle 6.9?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No it does not

@peternied peternied Mar 4, 2022

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Following the example from opensearch-project/common-utils#121

uses: actions/setup-java@v1
with:
java-version: ${{ matrix.jdk }}

- name: Set up build for JDK17 to use JKD11
if: matrix.jdk == 17
uses: actions/setup-java@v2
with:
distribution: temurin # Temurin is a distribution of adoptium
java-version: 11

- name: Checkout security
uses: actions/checkout@v2

Expand All @@ -39,7 +47,7 @@ jobs:
restore-keys: |
${{ runner.os }}-gradle-

- name: Package
- name: Run Tests
run: ./gradlew clean build -Dbuild.snapshot=false -x test

- name: Perform CodeQL Analysis
Expand Down
24 changes: 20 additions & 4 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,21 @@ test {
maxFailures = 30
maxRetries = 5
}
jacoco {
excludes = [

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why these dependencies need to be excluded from Jacoco?

@peternied peternied Mar 4, 2022

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In JDK17 these class files are not instrumentable (I don't have the background just dealt with the error), had to remove them to prevent test failures.

None of these exclusions are classes that we implement in our code, and thus do not need to be instrumented for our coverage statistics

"com.sun.jndi.dns.*",
"com.sun.security.sasl.gsskerb.*",
"java.sql.*",
"javax.script.*",
"org.jcp.xml.dsig.internal.dom.*",
"sun.nio.cs.ext.*",
"sun.security.ec.*",
"sun.security.jgss.*",
"sun.security.pkcs11.*",
"sun.security.smartcardio.*",
"sun.util.resources.provider.*"
]
}
}

gitProperties {
Expand All @@ -246,16 +261,17 @@ gitProperties {
}

// copied from: org.opensearch.gradle.dependencies.CompileOnlyResolvePlugin
project.getConfigurations().all(configuration -> {
project.getConfigurations().all { Configuration configuration ->
if (configuration.getName().equals(JavaPlugin.COMPILE_ONLY_CONFIGURATION_NAME)) {
NamedDomainObjectProvider<Configuration> resolvableCompileOnly = project.getConfigurations().register('resolveableCompileOnly');
resolvableCompileOnly.configure((c) -> {
resolvableCompileOnly.configure { c ->
c.setCanBeResolved(true);
c.setCanBeConsumed(false);
c.extendsFrom(configuration);
});
};
}
});
};



task bundle(dependsOn: jar, type: Zip) {
Expand Down
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.3-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-6.9-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists