From a79a999adbe9b165a9c28221cbe8892d403450c7 Mon Sep 17 00:00:00 2001 From: Alberto Bertogli Date: Thu, 27 Jul 2023 23:37:55 +0100 Subject: [PATCH] github: Run coverage tests This patch adds a job to the docker workflow to run coverage tests, and upload the results to coveralls. --- .github/workflows/docker.yml | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index b17872b..01228ad 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -26,10 +26,35 @@ 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 + - name: Docker info (for debugging) + run: docker info + - name: Build test image + run: docker build -t chasquid-test -f test/Dockerfile . + - name: Start container + run: docker run --name test1 -d -i -t chasquid-test /bin/bash + - name: Run coverage tests + run: > + docker exec --name test1 + ./test/cover.sh + - name: Install goveralls + run: > + docker exec --name test1 + go install github.com/mattn/goveralls@latest + - name: Upload coverage results + run: > + docker exec --name test1 + goveralls -coverprofile=.coverage/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