This commit updates the build pipeline to only run the checks (formatting and tests) with the build when non-JDK8 variants are used for sanity checks. See gh-22490