1
0
mirror of https://blitiri.com.ar/repos/chasquid synced 2025-12-26 16:07:04 +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:
Alberto Bertogli
2023-07-27 23:37:55 +01:00
parent a3f7914e29
commit 2e279de304
2 changed files with 29 additions and 2 deletions

View File

@@ -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