Skip to content

Commit eec59a3

Browse files
Merge pull request #127 from discord-modmail/coverage-artifact
ci: switch to coveralls
2 parents 42e8674 + a0fb30a commit eec59a3

File tree

5 files changed

+125
-118
lines changed

5 files changed

+125
-118
lines changed

.codecov.yml

Lines changed: 0 additions & 57 deletions
This file was deleted.

.github/workflows/lint_test.yml

Lines changed: 42 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -162,12 +162,50 @@ jobs:
162162
# This is saved to ./.coverage to be used by codecov to link a
163163
# coverage report to github.
164164
- name: Run tests and generate coverage report
165-
run: python -m pytest -n auto --dist loadfile --cov --disable-warnings -q
165+
id: run_tests
166+
run: python -m pytest tests -n auto --dist loadfile --cov --disable-warnings -q
166167

167-
# This step will publish the coverage reports to codecov.io and
168+
# This step will publish the coverage reports to coveralls.io and
168169
# print a "job" link in the output of the GitHub Action
169-
- name: Publish coverage report to codecov.io
170-
run: python -m codecov
170+
- name: Publish coverage report to coveralls.io
171+
# upload coverage even if a test run failed
172+
# this is a test, and may be removed in the future
173+
if: always() && (steps.run_tests.outcome == 'success' || steps.run_tests.outcome == 'failure')
174+
# important that we don't fail the workflow when coveralls is down
175+
continue-on-error: true
176+
env:
177+
COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }}
178+
COVERALLS_FLAG_NAME: coverage-${{ runner.os }}-python-${{ env.PYTHON_VERSION }}
179+
COVERALLS_PARALLEL: true
180+
COVERALLS_SERVICE_NAME: github
181+
run: python -m coveralls
182+
183+
coveralls-finish:
184+
name: Indicate completion to coveralls.io
185+
runs-on: ubuntu-latest
186+
needs: test
187+
# we don't want to fail the workflow when coveralls is down
188+
continue-on-error: true
189+
# we always want to ensure we attempt to send a finish to coveralls
190+
if: always()
191+
steps:
192+
# Set up a consistent version of Python
193+
- name: Set up Python 3.9
194+
id: python
195+
uses: actions/setup-python@v2
196+
with:
197+
python-version: '3.9'
198+
- name: Coveralls Finished
199+
continue-on-error: true
200+
env:
201+
COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }}
202+
COVERALLS_SERVICE_NAME: github
203+
# NOTE: this has a small thing where this will not always be the same with the poetry.lock file
204+
# given how this is installed for one api request, its not worth pinning to me.
205+
# any bugs caused by this can be solved when they occur
206+
run: |
207+
python3 -m pip install --upgrade coveralls
208+
python3 -m coveralls --finish
171209
172210
artifact:
173211
name: Generate Artifact

README.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
# Discord Modmail
22

33
[![Lint & Test](https://img.shields.io/github/workflow/status/discord-modmail/modmail/Lint%20&%20Test/main?label=Lint+%26+Test&logo=github&style=flat)](https://github.com/discord-modmail/modmail/actions/workflows/lint_test.yml "Lint and Test")
4-
[![Code Coverage](https://img.shields.io/codecov/c/gh/discord-modmail/modmail/main?logo=codecov&style=flat&label=Code+Coverage)](https://app.codecov.io/gh/discord-modmail/modmail "Code Coverage")
5-
[![Codacy Grade](https://img.shields.io/codacy/grade/78be21a49835484595aea556d5920638?logo=codacy&style=flat&label=Code+Quality)](https://www.codacy.com/gh/discord-modmail/modmail/dashboard "Codacy Grade")
4+
[![Code Coverage](https://img.shields.io/coveralls/github/discord-modmail/modmail?logo=coveralls&style=flat&label=Code+Coverage)](https://coveralls.io/github/discord-modmail/modmail)
65
[![Python](https://img.shields.io/static/v1?label=Python&message=3.8+%7C+3.9&color=blue&logo=Python&style=flat)](https://www.python.org/downloads/ "Python 3.8 | 3.9")
76
[![License](https://img.shields.io/github/license/discord-modmail/modmail?style=flat&label=License)](./LICENSE "License file")
87
[![Code Style](https://img.shields.io/static/v1?label=Code%20Style&message=black&color=000000&style=flat)](https://github.com/psf/black "The uncompromising python formatter")

0 commit comments

Comments
 (0)