mirror of
https://blitiri.com.ar/repos/chasquid
synced 2026-01-08 17:51:57 +00:00
github: Run coverage tests
This patch adds a job to the docker workflow to run coverage tests, and upload the results to coveralls.
This commit is contained in:
29
.github/workflows/docker.yml
vendored
29
.github/workflows/docker.yml
vendored
@@ -26,10 +26,37 @@ jobs:
|
|||||||
- name: Run tests
|
- name: Run tests
|
||||||
run: docker run --name test1 chasquid-test make test
|
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:
|
public-image:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
timeout-minutes: 15
|
timeout-minutes: 15
|
||||||
needs: integration
|
needs: [integration, coverage]
|
||||||
if: github.event_name == 'push'
|
if: github.event_name == 'push'
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ It's written in [Go](https://golang.org), and distributed under the
|
|||||||
|
|
||||||
[](https://github.com/albertito/chasquid/actions)
|
[](https://github.com/albertito/chasquid/actions)
|
||||||
[](https://goreportcard.com/report/github.com/albertito/chasquid)
|
[](https://goreportcard.com/report/github.com/albertito/chasquid)
|
||||||
[](https://blitiri.com.ar/p/chasquid/coverage.html)
|
[](https://coveralls.io/github/albertito/chasquid?branch=next)
|
||||||
[](https://blitiri.com.ar/p/chasquid/)
|
[](https://blitiri.com.ar/p/chasquid/)
|
||||||
[](https://webchat.oftc.net/?channels=%23chasquid)
|
[](https://webchat.oftc.net/?channels=%23chasquid)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user