Skip to content

Commit 2166a56

Browse files
authored
Run CodeCov through github actions and remove Tox (dropbox#225)
* Migrate travis to gthub actions: * Update test dependencies * Fix version mismatch and doc name * Update readme to fix validation issue
1 parent ef9397f commit 2166a56

File tree

7 files changed

+105
-73
lines changed

7 files changed

+105
-73
lines changed

.github/workflows/ci.yml

+61
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
name: CI
2+
on:
3+
pull_request:
4+
5+
jobs:
6+
CI:
7+
continue-on-error: true
8+
runs-on: ${{ matrix.os }}
9+
# Supported Versions:
10+
# https://github.com/actions/python-versions/blob/main/versions-manifest.json
11+
strategy:
12+
matrix:
13+
os: [macos-latest, windows-latest]
14+
python-version: [2.7, 3.5, 3.6, 3.7, 3.8, pypy2, pypy3]
15+
exclude:
16+
- os: windows-latest
17+
python-version: 3.6
18+
include:
19+
- os: linux
20+
python-version: 3.4
21+
steps:
22+
- uses: actions/checkout@v2
23+
- name: Setup Python environment
24+
uses: actions/setup-python@v1
25+
with:
26+
python-version: ${{ matrix.python }}
27+
- name: Install Requirements
28+
run: |
29+
python -m pip install --upgrade pip
30+
pip install flake8 pytest
31+
pip install -r requirements.txt
32+
pip install -r test/requirements.txt
33+
python setup.py install
34+
- name: Run Linter
35+
run: |
36+
flake8 setup.py dropbox example test
37+
- name: Run Unit Tests
38+
run: |
39+
pytest test/test_dropbox_unit.py
40+
Docs:
41+
runs-on: macos-latest
42+
steps:
43+
- uses: actions/checkout@v2
44+
- name: Setup Python environment
45+
uses: actions/setup-python@v1
46+
with:
47+
python-version: '3.7'
48+
- name: Install Requirements
49+
run: |
50+
python -m pip install --upgrade pip
51+
pip install twine sphinx
52+
pip install -r requirements.txt
53+
pip install -r test/requirements.txt
54+
python setup.py install
55+
- name: Test Doc Generation
56+
run: |
57+
sphinx-build -b html docs build/html
58+
- name: Test Dist Generation
59+
run: |
60+
python setup.py sdist bdist_wheel
61+
twine check dist/*

.github/workflows/codecovupload.yml

-34
This file was deleted.

.github/workflows/coverage.yml

+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: Coverage
2+
on:
3+
push:
4+
branches:
5+
- master
6+
pull_request:
7+
schedule:
8+
- cron: 0 0 * * *
9+
10+
jobs:
11+
Coverage:
12+
runs-on: ubuntu-latest
13+
steps:
14+
- uses: actions/checkout@v2
15+
- name: Setup Python environment
16+
uses: actions/setup-python@v1
17+
with:
18+
python-version: '3.7'
19+
- name: Install Requirements
20+
run: |
21+
python -m pip install --upgrade pip
22+
pip install coverage pytest
23+
pip install -r requirements.txt
24+
pip install -r test/requirements.txt
25+
python setup.py install
26+
- name: Generate Unit Test Coverage
27+
run: |
28+
coverage run --rcfile=.coveragerc -m pytest test/test_dropbox_unit.py
29+
coverage xml
30+
- name: Publish Coverage
31+
uses: codecov/[email protected]
32+
with:
33+
flags: unit
34+
fail_ci_if_error: true

.travis.yml

-25
This file was deleted.
File renamed without changes.

test/requirements.txt

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
pytest
22
mock
33
pytest-mock
4+
coverage

tox.ini

+9-14
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,6 @@
33
envlist = py{27,34,35,36,37,38,39-dev,py,py3},check,lint,docs,test_unit,coverage
44
skip_missing_interpreters = true
55

6-
[tox:travis]
7-
8-
2.7 = check, lint, docs, test_unit
9-
pypy = check, lint, docs, test_unit
10-
3.4 = check, lint, docs, test_unit
11-
3.5 = check, lint, docs, test_unit
12-
3.6 = check, lint, docs, test_unit
13-
3.7 = check, lint, docs, test_unit
14-
3.8 = check, lint, docs, test_unit
15-
3.9-dev = check, lint, docs, test_unit
16-
pypy3 = check, lint, docs, test_unit
17-
18-
196
[flake8]
207

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

7259
deps =
7360
-rtest/requirements.txt
74-
coverage
61+
62+
[testenv:codecov]
63+
64+
commands =
65+
coverage run --rcfile=.coveragerc -m pytest test/test_dropbox_unit.py
66+
coverage xml
67+
68+
deps =
69+
-rtest/requirements.txt
7570

7671
[testenv:test_unit]
7772

0 commit comments

Comments
 (0)