ci: let static checks don't depend on build

Build is a time consumable operation, skip build while let
ci run faster.

Fixes: #5777

Signed-off-by: Bin Liu <bin@hyper.sh>
This commit is contained in:
Bin Liu 2022-11-28 14:27:03 +08:00
parent f02bb1a9cb
commit e723bad0af
12 changed files with 31 additions and 2 deletions

View File

@ -21,7 +21,7 @@ TOOLS += log-parser
TOOLS += runk
TOOLS += trace-forwarder
STANDARD_TARGETS = build check clean install test vendor
STANDARD_TARGETS = build check clean install static-checks-build test vendor
default: all
@ -37,7 +37,7 @@ generate-protocols:
make -C src/agent generate-protocols
# Some static checks rely on generated source files of components.
static-checks: build
static-checks: static-checks-build
bash ci/static-checks.sh
docs-url-alive-check:

View File

@ -107,6 +107,8 @@ endef
##TARGET default: build code
default: $(TARGET) show-header
static-checks-build: $(GENERATED_CODE)
$(TARGET): $(GENERATED_CODE) $(TARGET_PATH)
$(TARGET_PATH): show-summary

View File

@ -16,6 +16,9 @@ build:
@echo "INFO: cargo build..."
cargo build --all-features --target $(TRIPLE)
static-checks-build:
@echo "INFO: static-checks-build do nothing.."
check: clippy format
clippy:

View File

@ -16,6 +16,9 @@ default: build
build:
cargo build --all-features
static-checks-build:
@echo "INFO: static-checks-build do nothing.."
check: clippy format
clippy:

View File

@ -361,6 +361,8 @@ GENERATED_FILES += $(CONFIGS)
runtime: $(TARGET)
static-checks-build: $(GENERATED_FILES)
$(TARGET): $(GENERATED_FILES) $(TARGET_PATH)
$(TARGET_PATH): $(SOURCES) | show-summary

View File

@ -680,6 +680,8 @@ handle_vendor:
vendor: handle_vendor
./hack/tree_status.sh
static-checks-build: $(GENERATED_FILES)
clean:
$(QUIET_CLEAN)rm -f \
$(CONFIGS) \

View File

@ -11,6 +11,9 @@ default: build
build:
@RUSTFLAGS="$(EXTRA_RUSTFLAGS) --deny warnings" cargo build --target $(TRIPLE) --$(BUILD_TYPE)
static-checks-build:
@echo "INFO: static-checks-build do nothing.."
clean:
cargo clean

View File

@ -36,6 +36,8 @@ $(TARGET): $(GENERATED_CODE)
build:
@RUSTFLAGS="$(EXTRA_RUSTFLAGS) --deny warnings" cargo build --target $(TRIPLE) $(if $(findstring release,$(BUILD_TYPE)),--release) $(EXTRA_RUSTFEATURES)
static-checks-build: $(GENERATED_CODE)
$(GENERATED_FILES): %: %.in
@sed $(foreach r,$(GENERATED_REPLACEMENTS),-e 's|@$r@|$($r)|g') "$<" > "$@"

View File

@ -29,6 +29,9 @@ install: $(TARGET)
install -d $(shell dirname $(DESTTARGET))
install $(TARGET) $(DESTTARGET)
static-checks-build:
@echo "INFO: static-checks-build do nothing.."
clean:
rm -f $(TARGET)

View File

@ -34,6 +34,9 @@ default: build
build:
@RUSTFLAGS="$(EXTRA_RUSTFLAGS) --deny warnings" cargo build --target $(TRIPLE) --$(BUILD_TYPE) $(EXTRA_RUSTFEATURES)
static-checks-build:
@echo "INFO: static-checks-build do nothing.."
install:
install -D $(TARGET_PATH) $(BINDIR)/$(TARGET)

View File

@ -11,6 +11,9 @@ default: build
build:
@RUSTFLAGS="$(EXTRA_RUSTFLAGS) --deny warnings" cargo build --target $(TRIPLE) --$(BUILD_TYPE)
static-checks-build:
@echo "INFO: static-checks-build do nothing.."
clean:
cargo clean

View File

@ -39,6 +39,9 @@ $(2) : $(1)/$(2)/Makefile
make -C $(1)/$(2)
build-$(2) : $(2)
static-checks-build-$(2):
make -C $(1)/$(2) static-checks-build
check-$(2) : $(2)
make -C $(1)/$(2) check