diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c6fe0b76e..189aaec0e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -37,13 +37,18 @@ jobs: path: .tools key: ${{ runner.os }}-${{ env.DEFAULT_GO_VERSION }}-${{ env.cache-name }}-${{ hashFiles('./internal/tools/**') }} # The step below is needed to not rebuild all the build tools. - - name: Set internal/tools/go.mod timestamp + - name: Set internal/tools timestamps run: | - filename="internal/tools/go.mod" - unixtime=$(git log -1 --format="%at" -- "${filename}") - touchtime=$(date -d @$unixtime +'%Y%m%d%H%M.%S') - touch -t ${touchtime} "${filename}" - ls -la --time-style=full-iso "${filename}" + git ls-files \ + internal/tools/go.mod \ + internal/tools/semconvkit \ + internal/tools/verifyreadmes \ + | while IFS= read -r filename; do + unixtime=$(git log -1 --format="%at" -- "${filename}") + touchtime=$(date -d @"${unixtime}" +'%Y%m%d%H%M.%S') + touch -t "${touchtime}" "${filename}" + ls -la --time-style=full-iso "${filename}" + done - name: Generate run: make generate - name: Run linters @@ -74,13 +79,18 @@ jobs: path: .tools key: ${{ runner.os }}-${{ env.DEFAULT_GO_VERSION }}-${{ env.cache-name }}-${{ hashFiles('./internal/tools/**') }} # The step below is needed to not rebuild all the build tools. - - name: Set internal/tools/go.mod timestamp + - name: Set internal/tools timestamps run: | - filename="internal/tools/go.mod" - unixtime=$(git log -1 --format="%at" -- "${filename}") - touchtime=$(date -d @$unixtime +'%Y%m%d%H%M.%S') - touch -t ${touchtime} "${filename}" - ls -la --time-style=full-iso "${filename}" + git ls-files \ + internal/tools/go.mod \ + internal/tools/semconvkit \ + internal/tools/verifyreadmes \ + | while IFS= read -r filename; do + unixtime=$(git log -1 --format="%at" -- "${filename}") + touchtime=$(date -d @"${unixtime}" +'%Y%m%d%H%M.%S') + touch -t "${touchtime}" "${filename}" + ls -la --time-style=full-iso "${filename}" + done - name: Run govulncheck run: make govulncheck diff --git a/Makefile b/Makefile index 9f6e6b511..42466f2d6 100644 --- a/Makefile +++ b/Makefile @@ -38,10 +38,14 @@ CROSSLINK = $(TOOLS)/crosslink $(TOOLS)/crosslink: PACKAGE=go.opentelemetry.io/build-tools/crosslink SEMCONVKIT = $(TOOLS)/semconvkit +SEMCONVKIT_FILES := $(sort $(shell find $(TOOLS_MOD_DIR)/semconvkit -type f)) $(TOOLS)/semconvkit: PACKAGE=go.opentelemetry.io/otel/$(TOOLS_MOD_DIR)/semconvkit +$(TOOLS)/semconvkit: $(SEMCONVKIT_FILES) VERIFYREADMES = $(TOOLS)/verifyreadmes +VERIFYREADMES_FILES := $(sort $(shell find $(TOOLS_MOD_DIR)/verifyreadmes -type f)) $(TOOLS)/verifyreadmes: PACKAGE=go.opentelemetry.io/otel/$(TOOLS_MOD_DIR)/verifyreadmes +$(TOOLS)/verifyreadmes: $(VERIFYREADMES_FILES) GOLANGCI_LINT = $(TOOLS)/golangci-lint $(TOOLS)/golangci-lint: PACKAGE=github.com/golangci/golangci-lint/v2/cmd/golangci-lint