CI: build system do not check submodule for CI

This commit is contained in:
He Yin Ling 2019-11-30 13:36:31 +08:00
parent b4863551a9
commit a11b15b92b
3 changed files with 19 additions and 4 deletions

View file

@ -31,6 +31,8 @@ variables:
# jobs can overwrite this variable to only fetch submodules they required # jobs can overwrite this variable to only fetch submodules they required
# set to "none" if don't need to fetch submodules # set to "none" if don't need to fetch submodules
SUBMODULES_TO_FETCH: "all" SUBMODULES_TO_FETCH: "all"
# tell build system do not check submodule update as we download archive instead of clone
IDF_SKIP_CHECK_SUBMODULES: 1
UNIT_TEST_BUILD_SYSTEM: cmake UNIT_TEST_BUILD_SYSTEM: cmake
EXAMPLE_TEST_BUILD_SYSTEM: cmake EXAMPLE_TEST_BUILD_SYSTEM: cmake

View file

@ -635,6 +635,11 @@ clean: app-clean bootloader-clean config-clean ldgen-clean
# #
# This only works for components inside IDF_PATH # This only works for components inside IDF_PATH
check-submodules: check-submodules:
# for internal use:
# skip submodule check if running on Gitlab CI and job is configured as not clone submodules
ifeq ($(IDF_SKIP_CHECK_SUBMODULES),1)
@echo "skip submodule check on internal CI"
else
# Check if .gitmodules exists, otherwise skip submodule check, assuming flattened structure # Check if .gitmodules exists, otherwise skip submodule check, assuming flattened structure
ifneq ("$(wildcard ${IDF_PATH}/.gitmodules)","") ifneq ("$(wildcard ${IDF_PATH}/.gitmodules)","")
@ -662,7 +667,7 @@ endef
# so the argument is suitable for use with 'git submodule' commands # so the argument is suitable for use with 'git submodule' commands
$(foreach submodule,$(subst $(IDF_PATH)/,,$(filter $(IDF_PATH)/%,$(COMPONENT_SUBMODULES))),$(eval $(call GenerateSubmoduleCheckTarget,$(submodule)))) $(foreach submodule,$(subst $(IDF_PATH)/,,$(filter $(IDF_PATH)/%,$(COMPONENT_SUBMODULES))),$(eval $(call GenerateSubmoduleCheckTarget,$(submodule))))
endif # End check for .gitmodules existence endif # End check for .gitmodules existence
endif
# PHONY target to list components in the build and their paths # PHONY target to list components in the build and their paths
list-components: list-components:

View file

@ -11,6 +11,14 @@ if(NOT GIT_FOUND)
else() else()
function(git_submodule_check root_path) function(git_submodule_check root_path)
# for internal use:
# skip submodule check if running on Gitlab CI and job is configured as not clone submodules
if($ENV{IDF_SKIP_CHECK_SUBMODULES})
if($ENV{IDF_SKIP_CHECK_SUBMODULES} EQUAL 1)
message("skip submodule check on internal CI")
return()
endif()
endif()
execute_process( execute_process(
COMMAND ${GIT_EXECUTABLE} submodule status COMMAND ${GIT_EXECUTABLE} submodule status