Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrate from Coveralls to Code Climate #3

Merged
merged 1 commit into from
Jan 9, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 37 additions & 6 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,47 @@ jobs:
tox-env: py38
- python-version: '3.9'
tox-env: py39
- python-version: '2.7'
tox-env: coveralls
- python-version: '2.7'
tox-env: flake8
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- run: pip install tox
- name: Install cc-test-reporter
run: |
curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
chmod +x ./cc-test-reporter
- run: pip install coverage tox
- run: ./cc-test-reporter before-build
- run: tox -e ${{ matrix.tox-env }}
- name: Format coverage
run: |
coverage xml
./cc-test-reporter format-coverage --input-type coverage.py --output 'coverage.${{ matrix.python-version }}.xml'
- uses: actions/upload-artifact@v2
with:
name: coverages
path: coverage.${{ matrix.python-version }}.xml
upload-coverage:
runs-on: ubuntu-20.04
needs: test
steps:
- uses: actions/download-artifact@v2
with:
name: coverages
- name: Install cc-test-reporter
run: |
curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
chmod +x ./cc-test-reporter
- name: Upload coverage
run: ./cc-test-reporter sum-coverage --output - coverage.*.xml | ./cc-test-reporter upload-coverage --debug --input -
env:
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}
CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }}
lint:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: '3.9'
- run: pip install tox
- run: tox -e flake8
14 changes: 3 additions & 11 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,10 @@
envlist = py{27,37,38,39}, flake8

[testenv]
commands = {envpython} -m unittest discover -v tests

[testenv:coveralls]
basepython = python2.7
passenv =
COVERALLS_REPO_TOKEN
deps = coveralls
commands =
coverage run --source=backquotes -m unittest discover tests
coveralls
deps = coverage
commands = {envpython} -m coverage run --source=backquotes -m unittest discover -v tests

[testenv:flake8]
basepython = python2.7
basepython = python3.9
deps = flake8
commands = flake8 backquotes.py setup.py