mirror of
https://github.com/Instagram/LibCST.git
synced 2025-12-23 10:35:53 +00:00
Switch code coverage from tox => gh actions (#510)
This commit is contained in:
parent
87f0becd01
commit
398d14e91b
3 changed files with 33 additions and 15 deletions
38
.github/workflows/build.yml
vendored
38
.github/workflows/build.yml
vendored
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -1,5 +1,4 @@
|
|||
black==20.8b1
|
||||
codecov>=2.1.4
|
||||
coverage>=4.5.4
|
||||
fixit==0.1.1
|
||||
flake8>=3.7.8
|
||||
|
|
|
|||
9
tox.ini
9
tox.ini
|
|
@ -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}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue