Skip to content

Commit

Permalink
Merge pull request #127 from discord-modmail/coverage-artifact
Browse files Browse the repository at this point in the history
ci: switch to coveralls
  • Loading branch information
onerandomusername authored Nov 27, 2021
2 parents 42e8674 + a0fb30a commit eec59a3
Show file tree
Hide file tree
Showing 5 changed files with 125 additions and 118 deletions.
57 changes: 0 additions & 57 deletions .codecov.yml

This file was deleted.

46 changes: 42 additions & 4 deletions .github/workflows/lint_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -162,12 +162,50 @@ jobs:
# This is saved to ./.coverage to be used by codecov to link a
# coverage report to github.
- name: Run tests and generate coverage report
run: python -m pytest -n auto --dist loadfile --cov --disable-warnings -q
id: run_tests
run: python -m pytest tests -n auto --dist loadfile --cov --disable-warnings -q

# This step will publish the coverage reports to codecov.io and
# This step will publish the coverage reports to coveralls.io and
# print a "job" link in the output of the GitHub Action
- name: Publish coverage report to codecov.io
run: python -m codecov
- name: Publish coverage report to coveralls.io
# upload coverage even if a test run failed
# this is a test, and may be removed in the future
if: always() && (steps.run_tests.outcome == 'success' || steps.run_tests.outcome == 'failure')
# important that we don't fail the workflow when coveralls is down
continue-on-error: true
env:
COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }}
COVERALLS_FLAG_NAME: coverage-${{ runner.os }}-python-${{ env.PYTHON_VERSION }}
COVERALLS_PARALLEL: true
COVERALLS_SERVICE_NAME: github
run: python -m coveralls

coveralls-finish:
name: Indicate completion to coveralls.io
runs-on: ubuntu-latest
needs: test
# we don't want to fail the workflow when coveralls is down
continue-on-error: true
# we always want to ensure we attempt to send a finish to coveralls
if: always()
steps:
# Set up a consistent version of Python
- name: Set up Python 3.9
id: python
uses: actions/setup-python@v2
with:
python-version: '3.9'
- name: Coveralls Finished
continue-on-error: true
env:
COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }}
COVERALLS_SERVICE_NAME: github
# NOTE: this has a small thing where this will not always be the same with the poetry.lock file
# given how this is installed for one api request, its not worth pinning to me.
# any bugs caused by this can be solved when they occur
run: |
python3 -m pip install --upgrade coveralls
python3 -m coveralls --finish
artifact:
name: Generate Artifact
Expand Down
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
# Discord Modmail

[![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")
[![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")
[![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")
[![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)
[![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")
[![License](https://img.shields.io/github/license/discord-modmail/modmail?style=flat&label=License)](./LICENSE "License file")
[![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")
Expand Down
Loading

0 comments on commit eec59a3

Please sign in to comment.