opensearch-plugin-template-java
opensearch-plugin-template-java copied to clipboard
[BUG] CI doesn't fail anymore if `gradlew build` fails
What is the bug?
if gradlew build
fails, the CI still happily continues and doesn't fail the build.
How can one reproduce the bug?
cause e.g. the javadoc
task to fail. as a real-world example see the windows build of https://github.com/aparo/opensearch-analysis-ik/pull/25: https://github.com/aparo/opensearch-analysis-ik/actions/runs/6143965464/job/16668432218?pr=25
What is the expected behavior?
if gradlew build
fails the CI must fail
What is your host/environment?
n/a
Do you have any screenshots?
n/a
Do you have any additional context?
this was introduced in #31 by @prudhvigodithi. the problem is that there's another command coming after it, but the two are not joined by &&
and no other mechanism is employed to cause the script to fail whenever any single step fails (e.g. using set -e
):
https://github.com/opensearch-project/opensearch-plugin-template-java/blob/71bdf03d030926bc56c4c4387b211094c7c40063/.github/workflows/CI.yml#L34-L36
the simplest option however would probably be to just run ./gradlew build publishPluginZipPublicationToZipStagingRepository
(and why is check
not called in the CI?)