Skip to content

Commit

Permalink
chore(ci): report test results to codecov (#95)
Browse files Browse the repository at this point in the history
* test results

Signed-off-by: Michael Crenshaw <[email protected]>

* handle failures

Signed-off-by: Michael Crenshaw <[email protected]>

* fix intentional bug

Signed-off-by: Michael Crenshaw <[email protected]>

---------

Signed-off-by: Michael Crenshaw <[email protected]>
  • Loading branch information
crenshaw-dev authored Oct 31, 2024
1 parent 5e1e31e commit ba00533
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
7 changes: 7 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,17 +26,24 @@ jobs:
- name: Run Unit-Tests
run: make test-parallel
- name: Generate code coverage artifacts
if: ${{ !cancelled() }}
uses: actions/upload-artifact@v4
with:
name: code-coverage
path: cover.out
- name: Upload code coverage information to codecov.io
if: ${{ !cancelled() }}
uses: codecov/[email protected]
with:
file: cover.out
fail_ci_if_error: false
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
- name: Upload test results to codecov.io
if: ${{ !cancelled() }}
uses: codecov/test-results-action@v1
with:
token: ${{ secrets.CODECOV_TOKEN }}
codegen:
name: Check Codegen
runs-on: ubuntu-latest
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,5 @@ go.work
# Github Certificates
*.pem
secret.yaml

junit.xml
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -92,11 +92,11 @@ test-deps: ginkgo manifests generate fmt vet envtest

.PHONY: test-parallel
test-parallel: test-deps ## Run tests in parallel
KUBEBUILDER_ASSETS="$(shell $(ENVTEST) use $(ENVTEST_K8S_VERSION) --bin-dir $(LOCALBIN) -p path)" $(GINKGO) -p -r -v -cover -coverprofile=cover.out internal/
KUBEBUILDER_ASSETS="$(shell $(ENVTEST) use $(ENVTEST_K8S_VERSION) --bin-dir $(LOCALBIN) -p path)" $(GINKGO) -p -r -v -cover -coverprofile=cover.out --junit-report=junit.xml internal/

.PHONY: test-parallel-repeat3
test-parallel-repeat3: test-deps ## Run tests in parallel 3 times to check for flakiness --repeat does not count the first run
KUBEBUILDER_ASSETS="$(shell $(ENVTEST) use $(ENVTEST_K8S_VERSION) --bin-dir $(LOCALBIN) -p path)" $(GINKGO) -p -r -v -cover -coverprofile=cover.out --repeat=2 internal/
KUBEBUILDER_ASSETS="$(shell $(ENVTEST) use $(ENVTEST_K8S_VERSION) --bin-dir $(LOCALBIN) -p path)" $(GINKGO) -p -r -v -cover -coverprofile=cover.out --junit-report=junit.xml --repeat=2 internal/

.PHONY: lint nilaway-no-test
lint: golangci-lint ## Run golangci-lint linter & yamllint
Expand Down

0 comments on commit ba00533

Please sign in to comment.