Skip to content

Commit

Permalink
Run CodeCov through github actions and remove Tox (#225)
Browse files Browse the repository at this point in the history
* Migrate travis to gthub actions:
* Update test dependencies
* Fix version mismatch and doc name
* Update readme to fix validation issue
  • Loading branch information
rogebrd authored Sep 15, 2020
1 parent ef9397f commit 2166a56
Show file tree
Hide file tree
Showing 7 changed files with 105 additions and 73 deletions.
61 changes: 61 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
name: CI
on:
pull_request:

jobs:
CI:
continue-on-error: true
runs-on: ${{ matrix.os }}
# Supported Versions:
# https://github.com/actions/python-versions/blob/main/versions-manifest.json
strategy:
matrix:
os: [macos-latest, windows-latest]
python-version: [2.7, 3.5, 3.6, 3.7, 3.8, pypy2, pypy3]
exclude:
- os: windows-latest
python-version: 3.6
include:
- os: linux
python-version: 3.4
steps:
- uses: actions/checkout@v2
- name: Setup Python environment
uses: actions/setup-python@v1
with:
python-version: ${{ matrix.python }}
- name: Install Requirements
run: |
python -m pip install --upgrade pip
pip install flake8 pytest
pip install -r requirements.txt
pip install -r test/requirements.txt
python setup.py install
- name: Run Linter
run: |
flake8 setup.py dropbox example test
- name: Run Unit Tests
run: |
pytest test/test_dropbox_unit.py
Docs:
runs-on: macos-latest
steps:
- uses: actions/checkout@v2
- name: Setup Python environment
uses: actions/setup-python@v1
with:
python-version: '3.7'
- name: Install Requirements
run: |
python -m pip install --upgrade pip
pip install twine sphinx
pip install -r requirements.txt
pip install -r test/requirements.txt
python setup.py install
- name: Test Doc Generation
run: |
sphinx-build -b html docs build/html
- name: Test Dist Generation
run: |
python setup.py sdist bdist_wheel
twine check dist/*
34 changes: 0 additions & 34 deletions .github/workflows/codecovupload.yml

This file was deleted.

34 changes: 34 additions & 0 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Coverage
on:
push:
branches:
- master
pull_request:
schedule:
- cron: 0 0 * * *

jobs:
Coverage:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Setup Python environment
uses: actions/setup-python@v1
with:
python-version: '3.7'
- name: Install Requirements
run: |
python -m pip install --upgrade pip
pip install coverage pytest
pip install -r requirements.txt
pip install -r test/requirements.txt
python setup.py install
- name: Generate Unit Test Coverage
run: |
coverage run --rcfile=.coveragerc -m pytest test/test_dropbox_unit.py
coverage xml
- name: Publish Coverage
uses: codecov/[email protected]
with:
flags: unit
fail_ci_if_error: true
25 changes: 0 additions & 25 deletions .travis.yml

This file was deleted.

File renamed without changes.
1 change: 1 addition & 0 deletions test/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
pytest
mock
pytest-mock
coverage
23 changes: 9 additions & 14 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,6 @@
envlist = py{27,34,35,36,37,38,39-dev,py,py3},check,lint,docs,test_unit,coverage
skip_missing_interpreters = true

[tox:travis]

2.7 = check, lint, docs, test_unit
pypy = check, lint, docs, test_unit
3.4 = check, lint, docs, test_unit
3.5 = check, lint, docs, test_unit
3.6 = check, lint, docs, test_unit
3.7 = check, lint, docs, test_unit
3.8 = check, lint, docs, test_unit
3.9-dev = check, lint, docs, test_unit
pypy3 = check, lint, docs, test_unit


[flake8]

# See <https://pycodestyle.readthedocs.io/en/latest/intro.html#error-codes>
Expand Down Expand Up @@ -71,7 +58,15 @@ commands =

deps =
-rtest/requirements.txt
coverage

[testenv:codecov]

commands =
coverage run --rcfile=.coveragerc -m pytest test/test_dropbox_unit.py
coverage xml

deps =
-rtest/requirements.txt

[testenv:test_unit]

Expand Down

0 comments on commit 2166a56

Please sign in to comment.