diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 50c636db41..b87d5bd3d2 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -109,6 +109,19 @@ jobs: name: "${{ needs.setup-tests.outputs.file-prefix }}-${{ matrix.part }}-coverage" path: ./${{ matrix.part }}profile.out + build-tests: + # TODO[1760]: Delete this build-tests action once the tests reliably pass again. + needs: setup-tests + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-go@v4 + if: needs.setup-tests.outputs.should-run + with: + go-version: ${{ needs.setup-tests.outputs.go-version }} + - name: build tests + run: | + make build-tests # This action performs a code coverage assessment but filters out generated code from proto based types # and grpc services diff --git a/Makefile b/Makefile index 60538d911d..001783950a 100644 --- a/Makefile +++ b/Makefile @@ -132,6 +132,8 @@ install: go.sum CGO_LDFLAGS="$(CGO_LDFLAGS)" CGO_CFLAGS="$(CGO_CFLAGS)" $(GO) install $(BUILD_FLAGS) ./cmd/provenanced build: validate-go-version go.sum + # TODO[1760]: Remove this delay once we're stable again. + @if [ -z "${ACK_50}" ]; then printf '\033[93mWARNING:\033[0m This branch is currently unstable and should not be built for use.\n To bypass this 10 second delay: ACK_50=1 make build\n'; sleep 10; fi mkdir -p $(BUILDDIR) CGO_LDFLAGS="$(CGO_LDFLAGS)" CGO_CFLAGS="$(CGO_CFLAGS)" $(GO) build -o $(BUILDDIR)/ $(BUILD_FLAGS) ./cmd/provenanced @@ -353,18 +355,25 @@ $(CHECK_TEST_TARGETS): run-tests run-tests: go.sum ifneq (,$(shell which tparse 2>/dev/null)) - $(GO) test -mod=readonly -json $(ARGS) -tags='$(TAGS)'$(TEST_PACKAGES) | tparse + $(GO) test -mod=readonly -json $(ARGS) -tags='$(TAGS)' $(TEST_PACKAGES) | tparse else $(GO) test -mod=readonly $(ARGS) -tags='$(TAGS)' $(TEST_PACKAGES) endif +build-tests: go.sum +ifneq (,$(shell which tparse 2>/dev/null)) + $(GO) test -mod=readonly -json $(ARGS) -tags='$(TAGS)' -run='ZYX_NOPE_NOPE_XYZ' $(TEST_PACKAGES) | tparse +else + $(GO) test -mod=readonly $(ARGS) -tags='$(TAGS)' -run='ZYX_NOPE_NOPE_XYZ' $(TEST_PACKAGES) +endif + test-cover: export VERSION=$(VERSION); bash -x contrib/test_cover.sh benchmark: $(GO) test -mod=readonly -bench=. $(PACKAGES_NOSIMULATION) -.PHONY: test test-all test-unit test-race test-cover benchmark run-tests $(TEST_TARGETS) +.PHONY: test test-all test-unit test-race test-cover benchmark run-tests build-tests $(TEST_TARGETS) ############################## # Test Network Targets