Skip to content

Commit

Permalink
github: Run coverage tests
Browse files Browse the repository at this point in the history
This patch adds a job to the docker workflow to run coverage tests, and
upload the results to coveralls.
  • Loading branch information
albertito committed Jul 28, 2023
1 parent 4f0bc2a commit 57803cf
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 2 deletions.
29 changes: 28 additions & 1 deletion .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,37 @@ jobs:
- name: Run tests
run: docker run --name test1 chasquid-test make test

coverage:
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v3
with:
go-version: ">=1.20"
- name: Install goveralls
run: go install github.com/mattn/goveralls@latest
- name: Docker info (for debugging)
run: docker info
- name: Build test image
run: docker build -t chasquid-test -f test/Dockerfile .
- name: Run coverage tests
run: docker run --name test1 chasquid-test test/cover.sh
- name: Extract coverage results
run: >
docker cp
test1:/go/src/blitiri.com.ar/go/chasquid/.coverage/final.out
.
- name: Upload coverage results
run: >
goveralls
-coverprofile=final.out
-repotoken=${{ secrets.COVERALLS_TOKEN }}
public-image:
runs-on: ubuntu-latest
timeout-minutes: 15
needs: integration
needs: [integration, coverage]
if: github.event_name == 'push'
steps:
- uses: actions/checkout@v3
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ It's written in [Go](https://golang.org), and distributed under the

[![Go tests](https://github.com/albertito/chasquid/actions/workflows/gotests.yml/badge.svg?branch=master)](https://github.com/albertito/chasquid/actions)
[![Go Report Card](https://goreportcard.com/badge/github.com/albertito/chasquid)](https://goreportcard.com/report/github.com/albertito/chasquid)
[![Coverage](https://img.shields.io/badge/coverage-next-brightgreen.svg)](https://blitiri.com.ar/p/chasquid/coverage.html)
[![Coverage](https://coveralls.io/repos/github/albertito/chasquid/badge.svg?branch=next)](https://coveralls.io/github/albertito/chasquid?branch=next)
[![Docs](https://img.shields.io/badge/docs-reference-blue.svg)](https://blitiri.com.ar/p/chasquid/)
[![OFTC IRC](https://img.shields.io/badge/chat-oftc-blue.svg)](https://webchat.oftc.net/?channels=%23chasquid)

Expand Down

0 comments on commit 57803cf

Please sign in to comment.