Skip to content

Commit

Permalink
chore: update coveralls service to gh
Browse files Browse the repository at this point in the history
  • Loading branch information
mefellows committed Jun 27, 2022
1 parent 89126b2 commit 6c15f17
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 13 deletions.
20 changes: 19 additions & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ env:
LOG_LEVEL: trace
GIT_COMMIT: ${{ github.sha }}
GIT_REF: ${{ github.ref }}
COVERALLS_TOKEN: ${{ secrets.GITHUB_TOKEN }}

jobs:
test:
Expand All @@ -29,4 +30,21 @@ jobs:
- name: Checkout code
uses: actions/checkout@v2
- name: Test
run: GIT_BRANCH=${GIT_REF:11} DOCKER_GATEWAY_HOST=172.17.0.1 DOCKER_HOST_HTTP="http://172.17.0.1" make
run: GIT_BRANCH=${GIT_REF:11} DOCKER_GATEWAY_HOST=172.17.0.1 DOCKER_HOST_HTTP="http://172.17.0.1" make
- name: Coveralls Parallel
uses: coverallsapp/github-action@master
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
flag-name: run-${{ matrix.go-version }}
path-to-lcov: ./coverage.txt
parallel: true

finish:
needs: test
runs-on: ubuntu-latest
steps:
- name: Coveralls Finished
uses: coverallsapp/github-action@master
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
parallel-finished: true
17 changes: 5 additions & 12 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ TEST?=./...
DOCKER_HOST_HTTP?="http://host.docker.internal"
PACT_CLI="docker run --rm -v ${PWD}:${PWD} -e PACT_BROKER_BASE_URL=$(DOCKER_HOST_HTTP) -e PACT_BROKER_USERNAME -e PACT_BROKER_PASSWORD pactfoundation/pact-cli"

ci:: docker deps clean bin test pact goveralls
ci:: docker deps clean bin test pact

docker:
@echo "--- 🛠 Starting docker"
Expand All @@ -25,16 +25,9 @@ clean:
deps:
@echo "--- 🐿 Fetching build dependencies "
cd /tmp; \
go install github.com/axw/gocov/gocov@latest; \
go install github.com/mattn/goveralls@latest; \
go install golang.org/x/tools/cmd/cover@latest; \
go install github.com/modocache/gover@latest; \
go install github.com/mitchellh/gox@latest; \
cd -

goveralls:
goveralls -service="travis-ci" -coverprofile=coverage.txt -repotoken $(COVERALLS_TOKEN)

install:
@if [ ! -d pact/bin ]; then\
@echo "--- 🐿 Installing Pact CLI dependencies"; \
Expand Down Expand Up @@ -66,13 +59,13 @@ test: deps install
@echo "mode: count" > coverage.txt
@for d in $$(go list ./... | grep -v vendor | grep -v examples); \
do \
go test -race -coverprofile=profile.out -covermode=atomic $$d; \
go test -race -coverprofile=profile.cov -covermode=atomic $$d; \
if [ $$? != 0 ]; then \
exit 1; \
fi; \
if [ -f profile.out ]; then \
cat profile.out | tail -n +2 >> coverage.txt; \
rm profile.out; \
if [ -f profile.cov ]; then \
cat profile.cov | tail -n +2 >> coverage.txt; \
rm profile.cov; \
fi; \
done; \
go tool cover -func coverage.txt
Expand Down

0 comments on commit 6c15f17

Please sign in to comment.