Skip to content

Commit

Permalink
enable unit tests as part of PR checks pipeline
Browse files Browse the repository at this point in the history
Signed-off-by: odubajDT <ondrej.dubaj@dynatrace.com>
  • Loading branch information
odubajDT committed Mar 14, 2023
1 parent a66d30e commit 555edf2
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
18 changes: 18 additions & 0 deletions .github/workflows/pr-checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,24 @@ jobs:
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3

unit-test:
name: Unit Tests
needs: prepare_ci_run
runs-on: ubuntu-22.04
steps:
- name: Check out code
uses: actions/checkout@v3

- name: Install Go
uses: actions/setup-go@v3
with:
go-version: ${{ env.DEFAULT_GO_VERSION }}
cache: true
cache-dependency-path: 'go.sum'

- name: Unit Test
run: make unit-test

docker-local:
permissions:
security-events: write # for github/codeql-action/upload-sarif to upload SARIF results
Expand Down
4 changes: 4 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,10 @@ vet: ## Run go vet against code.
test: manifests generate fmt vet envtest ## Run tests.
KUBEBUILDER_ASSETS="$(shell $(ENVTEST) use $(ENVTEST_K8S_VERSION) -p path)" go test ./... -coverprofile cover.out

.PHONY: unit-test
unit-test: manifests fmt vet generate envtest ## Run tests.
go test ./apis/... -v

## Requires the operator to be deployed
.PHONY: e2e-test
e2e-test: manifests generate fmt vet
Expand Down

0 comments on commit 555edf2

Please sign in to comment.