Skip to content

Commit

Permalink
[Makefile] Clean up check-contrib target (#6049)
Browse files Browse the repository at this point in the history
Make sure contrib is fully restored locally but ignore it in CI
  • Loading branch information
dmitryax authored Sep 13, 2022
1 parent 9f14f5e commit 38826ae
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/contrib-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,4 @@ jobs:
run: |
contrib_path=/tmp/opentelemetry-collector-contrib
git clone https://github.com/open-telemetry/opentelemetry-collector-contrib.git $contrib_path
make CONTRIB_PATH=$contrib_path check-contrib
make CONTRIB_PATH=$contrib_path SKIP_RESTORE_CONTRIB=true check-contrib
12 changes: 11 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -318,8 +318,18 @@ check-contrib:
@$(MAKE) -C $(CONTRIB_PATH) for-all CMD="$(GOCMD) mod edit -replace go.opentelemetry.io/collector/semconv=$(CURDIR)/semconv"
@$(MAKE) -C $(CONTRIB_PATH) -j2 gotidy
@$(MAKE) -C $(CONTRIB_PATH) test
@echo Restoring contrib to no longer use this core checkout
@if [ -z "$(SKIP_RESTORE_CONTRIB)" ]; then \
$(MAKE) restore-contrib; \
fi

# Restores contrib to its original state after running check-contrib.
.PHONY: restore-contrib
restore-contrib:
@echo Restoring contrib at $(CONTRIB_PATH) to its original state
@$(MAKE) -C $(CONTRIB_PATH) for-all CMD="$(GOCMD) mod edit -dropreplace go.opentelemetry.io/collector"
@$(MAKE) -C $(CONTRIB_PATH) for-all CMD="$(GOCMD) mod edit -dropreplace go.opentelemetry.io/collector/pdata"
@$(MAKE) -C $(CONTRIB_PATH) for-all CMD="$(GOCMD) mod edit -dropreplace go.opentelemetry.io/collector/semconv"
@$(MAKE) -C $(CONTRIB_PATH) -j2 gotidy

# List of directories where certificates are stored for unit tests.
CERT_DIRS := localhost|""|config/configgrpc/testdata \
Expand Down

0 comments on commit 38826ae

Please sign in to comment.