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 27, 2023
1 parent 4f0bc2a commit ef72973
Showing 1 changed file with 26 additions and 1 deletion.
27 changes: 26 additions & 1 deletion .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 test1
./test/cover.sh
- name: Install goveralls
run: >
docker exec test1
go install github.com/mattn/goveralls@latest
- name: Upload coverage results
run: >
docker exec 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
Expand Down

0 comments on commit ef72973

Please sign in to comment.