run verify-codegen for doc only PRs
@@ -147,14 +147,20 @@ function markdown_build_tests() {
# Default build test runner that:
# * check markdown files
-# * `go build` on the entire repo
# * run `/hack/verify-codegen.sh` (if it exists)
+# * `go build` on the entire repo
# * check licenses in all go packages
function default_build_test_runner() {
local failed=0
- # Perform markdown build checks first
+ # Perform markdown build checks
markdown_build_tests || failed=1
- # For documentation PRs, just check the md files
+ # Run verify-codegen check
+ if [[ -f ./hack/verify-codegen.sh ]]; then
+ subheader "Checking autogenerated code is up-to-date"
+ report_build_test Verify_CodeGen ./hack/verify-codegen.sh || failed=1
+ fi
+ # For documentation PRs, just check the md files and run
+ # verify-codegen (as md files can be auto-generated in some repos).
(( IS_DOCUMENTATION_PR )) && return ${failed}
# Don't merge these two lines, or return code will always be 0.
local go_pkg_dirs
@@ -189,10 +195,6 @@ function default_build_test_runner() {
local errors_go="$(echo -e "${errors_go1}\n${errors_go2}" | uniq)"
create_junit_xml _build_tests Build_Go "${errors_go}"
- if [[ -f ./hack/verify-codegen.sh ]]; then
- subheader "Checking autogenerated code is up-to-date"
- report_build_test Verify_CodeGen ./hack/verify-codegen.sh || failed=1
- fi
# Check that we don't have any forbidden licenses in our images.
subheader "Checking for forbidden licenses"
report_build_test Check_Licenses check_licenses ${go_pkg_dirs} || failed=1
