Skip to content

Commit

Permalink
chore: use tkn tasks from PR branch in CI (#1914)
Browse files Browse the repository at this point in the history
Signed-off-by: Matej Vasek <mvasek@redhat.com>
  • Loading branch information
matejvasek committed Aug 9, 2023
1 parent c9b0176 commit a74e1d7
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 2 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/test-e2e-oncluster-runtime.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/test-e2e-oncluster.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/test-integration.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/test-podman.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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

13 changes: 11 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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

Expand Down

0 comments on commit a74e1d7

Please sign in to comment.