diff --git a/.github/workflows/test-e2e-oncluster-runtime.yaml b/.github/workflows/test-e2e-oncluster-runtime.yaml index 858c2639ea..ced3c3898f 100644 --- a/.github/workflows/test-e2e-oncluster-runtime.yaml +++ b/.github/workflows/test-e2e-oncluster-runtime.yaml @@ -29,6 +29,8 @@ jobs: - name: E2E On Cluster Test (Runtimes) env: TEST_TAGS: runtime + FUNC_REPO_REF: ${{ github.event.pull_request.head.repo.full_name }} + FUNC_REPO_BRANCH_REF: ${{ github.head_ref }} run: make test-e2e-on-cluster - uses: codecov/codecov-action@v3 with: diff --git a/.github/workflows/test-e2e-oncluster.yaml b/.github/workflows/test-e2e-oncluster.yaml index f6e9d35585..69b9f89508 100644 --- a/.github/workflows/test-e2e-oncluster.yaml +++ b/.github/workflows/test-e2e-oncluster.yaml @@ -29,6 +29,8 @@ jobs: - name: E2E On Cluster Test env: E2E_RUNTIMES: "" + FUNC_REPO_REF: ${{ github.event.pull_request.head.repo.full_name }} + FUNC_REPO_BRANCH_REF: ${{ github.head_ref }} run: make test-e2e-on-cluster - uses: codecov/codecov-action@v3 with: diff --git a/.github/workflows/test-integration.yaml b/.github/workflows/test-integration.yaml index d0933b3419..fe5dda8cd1 100644 --- a/.github/workflows/test-integration.yaml +++ b/.github/workflows/test-integration.yaml @@ -42,6 +42,9 @@ jobs: - name: Patch Hosts run: ./hack/patch-hosts.sh - name: Integration Test + env: + FUNC_REPO_REF: ${{ github.event.pull_request.head.repo.full_name }} + FUNC_REPO_BRANCH_REF: ${{ github.head_ref }} run: make test-integration - name: Dump Cluster Logs if: always() diff --git a/.github/workflows/test-podman.yaml b/.github/workflows/test-podman.yaml index 5b162f7a4f..88392913a4 100644 --- a/.github/workflows/test-podman.yaml +++ b/.github/workflows/test-podman.yaml @@ -37,5 +37,8 @@ jobs: - name: Local Registry run: ./hack/registry.sh - name: Integration Test Podman + env: + FUNC_REPO_REF: ${{ github.event.pull_request.head.repo.full_name }} + FUNC_REPO_BRANCH_REF: ${{ github.head_ref }} run: ./hack/test-integration-podman.sh diff --git a/Makefile b/Makefile index 69d94b99a8..0e3ee85cd0 100644 --- a/Makefile +++ b/Makefile @@ -27,7 +27,16 @@ VTAG := $(shell git tag --points-at HEAD | head -1) VTAG := $(shell [ -z $(VTAG) ] && echo $(ETAG) || echo $(VTAG)) VERS ?= $(shell git describe --tags --match 'v*') KVER ?= $(shell git describe --tags --match 'knative-*') -LDFLAGS := "-X main.date=$(DATE) -X main.vers=$(VERS) -X main.kver=$(KVER) -X main.hash=$(HASH)" + +LDFLAGS := -X main.date=$(DATE) -X main.vers=$(VERS) -X main.kver=$(KVER) -X main.hash=$(HASH) +ifneq ($(FUNC_REPO_REF),) + LDFLAGS += -X knative.dev/func/pkg/pipelines/tekton.FuncRepoRef=$(FUNC_REPO_REF) +endif +ifneq ($(FUNC_REPO_BRANCH_REF),) + LDFLAGS += -X knative.dev/func/pkg/pipelines/tekton.FuncRepoBranchRef=$(FUNC_REPO_BRANCH_REF) +endif +LDFLAGS := "$(LDFLAGS)" + MAKEFILE_DIR := $(dir $(abspath $(lastword $(MAKEFILE_LIST)))) # All Code prerequisites, including generated files, etc. @@ -193,7 +202,7 @@ templates/certs/ca-certificates.crt: ################### test-integration: ## Run integration tests using an available cluster. - go test -tags integration -timeout 30m --coverprofile=coverage.txt ./... -v + go test -ldflags $(LDFLAGS) -tags integration -timeout 30m --coverprofile=coverage.txt ./... -v .PHONY: func-instrumented