Skip to content

Commit

Permalink
ci: submit coverage information to coveralls.io
Browse files Browse the repository at this point in the history
We cannot easily use the official GitHub Action from
https://github.com/marketplace/actions/coveralls-github-action because
it expects its input to be in LCOV format, which is not what coverage.py
emits. See coverallsapp/github-action#4 for
more discussion about this.

If coverallsapp/github-action#25 were merged to
support the Cobertura XML format, then `coverage xml` could be used to
generate that format. Since it's not, it's simplest to just install the
Python client for coveralls from PyPI.
  • Loading branch information
wjt committed Dec 18, 2019
1 parent d80e4e6 commit 86d0a60
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 3 deletions.
2 changes: 2 additions & 0 deletions .coveragerc
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[run]
source = src,tests
8 changes: 5 additions & 3 deletions .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: docker build
- name: Build container
run: docker build -t flatpak-external-data-checker .
- name: run tests
run: docker run -v $PWD:/opt -w /opt flatpak-external-data-checker python3 -m unittest discover --verbose --buffer
- name: Run tests in container
run: docker run -v $PWD:/opt -w /opt flatpak-external-data-checker python3-coverage run -m unittest discover --verbose --buffer
- name: Submit code coverage to Coveralls.io
run: docker run --env COVERALLS_REPO_TOKEN=${{ secrets.COVERALLS_REPO_TOKEN }} -v $PWD:/opt -w /opt flatpak-external-data-checker coveralls
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
__pycache__
/.coverage
/coverage.xml
5 changes: 5 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,18 @@ RUN apt-get update \
gir1.2-glib-2.0 \
gir1.2-json-1.0 \
python3-apt \
python3-coverage \
python3-gi \
python3-github \
python3-pip \
python3-ruamel.yaml \
python3-setuptools \
python3-tenacity \
&& apt-get clean \
&& rmdir /var/cache/apt/archives/partial

RUN pip3 install coveralls

ARG USER_ID=1000
ARG GROUP_ID=1000
RUN groupadd -g $GROUP_ID user && \
Expand Down

0 comments on commit 86d0a60

Please sign in to comment.