Switch code coverage from tox => gh actions (#510)

This commit is contained in:
Luke Petre 2021-08-11 11:41:18 -04:00 committed by GitHub
parent 87f0becd01
commit 398d14e91b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 33 additions and 15 deletions

View file

@ -21,9 +21,6 @@ jobs:
- os: ubuntu-latest
python-version: 3.8
environment: docs
- os: ubuntu-latest
python-version: 3.8
environment: coverage
- os: ubuntu-latest
python-version: 3.8
environment: pyre
@ -46,7 +43,7 @@ jobs:
- name: install tox
run: |
python -m pip install --upgrade pip
pip install tox tox-gh-actions -r requirements.txt -r requirements-dev.txt
pip install tox-gh-actions -r requirements.txt -r requirements-dev.txt
- name: run tox
run: tox --workdir ~/cache/tox -e ${{ matrix.environment }}
- name: Archive Docs
@ -55,8 +52,39 @@ jobs:
with:
name: sphinx-docs
path: docs/build
# Upload test coverage
coverage:
needs: tox
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 3.8
- name: pip cache
uses: actions/cache@v2
id: cache
with:
path: '~/cache'
key: pip-ubuntu-latest-3.8-test-${{ hashFiles('tox.ini', 'requirements.txt', 'requirements-dev.txt', 'setup.py') }}
- name: install pip
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt -r requirements-dev.txt
- name: generate coverage
run: |
coverage run setup.py test
coverage xml -i
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v2
with:
files: coverage.xml
fail_ci_if_error: true
verbose: true
- name: Archive Coverage
if: matrix.environment == 'coverage'
uses: actions/upload-artifact@v2
with:
name: coverage

View file

@ -1,5 +1,4 @@
black==20.8b1
codecov>=2.1.4
coverage>=4.5.4
fixit==0.1.1
flake8>=3.7.8

View file

@ -34,15 +34,6 @@ commands =
black {posargs:libcst/}
python3 -m fixit.cli.apply_fix
[testenv:coverage]
passenv =
CI
CIRCLECI
CIRCLE_*
commands =
coverage run setup.py test
codecov
[testenv:pyre]
usedevelop=True
setenv = PYTHONPATH = {toxinidir}