diff --git a/.github/workflows/pull_request.yml b/.github/workflows/pull_request.yml index d00fc3d0f..0055897ab 100644 --- a/.github/workflows/pull_request.yml +++ b/.github/workflows/pull_request.yml @@ -76,8 +76,15 @@ jobs: - name: Interact with the cluster run: kubectl get nodes - - name: Run receptor tests - run: make test + - name: Run receptor tests with coverage + run: make coverage + + - name: Upload coverage reports to Codecov + uses: codecov/codecov-action@v3 + with: + fail_ci_if_error: true + token: ${{ secrets.CODECOV_TOKEN }} + verbose: true - name: get k8s logs if: ${{ failure() }} diff --git a/Makefile b/Makefile index 530aec581..5505c548d 100644 --- a/Makefile +++ b/Makefile @@ -98,6 +98,10 @@ testloop: receptor make test; do \ i=$$((i+1)); done +coverage: + PATH="${PWD}:${PATH}" \ + go test ./... $(TESTCMD) -count=1 -race -timeout 5m -coverprofile=coverage.txt -covermode=atomic + kubectl: curl -LO "https://storage.googleapis.com/kubernetes-release/release/$$(curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt)/bin/linux/amd64/kubectl" chmod a+x kubectl diff --git a/README.md b/README.md index 848f77efe..51abdab83 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,8 @@ Receptor ======== +[![codecov](https://codecov.io/gh/ansible/receptor/branch/devel/graph/badge.svg?token=RAW5Bvh3hM)](https://codecov.io/gh/ansible/receptor) + Receptor is an overlay network intended to ease the distribution of work across a large and dispersed collection of workers. Receptor nodes establish peer-to-peer connections with each other via existing networks. Once connected, the Receptor mesh provides datagram (UDP-like) and stream (TCP-like) capabilities to applications, as well as robust unit-of-work handling with resiliency against transient network failures. See the readthedocs page for Receptor at: