Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 7d6e015

Browse files
committed
consolidate lint, test, coverage actions
1 parent 5329bef commit 7d6e015

1 file changed

Lines changed: 104 additions & 0 deletions

File tree

Lines changed: 104 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,104 @@
1+
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
2+
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
3+
4+
name: Run basic unit tests
5+
6+
on:
7+
push:
8+
branches: [master]
9+
pull_request:
10+
branches: [master]
11+
12+
jobs:
13+
lint:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- uses: actions/checkout@v2
17+
- name: Set up Python
18+
uses: actions/setup-python@v2
19+
with:
20+
python-version: 3.9
21+
- name: Install dependencies
22+
run: |
23+
python -m pip install --upgrade pip
24+
pip install .[dev]
25+
- name: Lint with flake8
26+
run: |
27+
# stop the build if there are Python syntax errors or undefined names
28+
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics --exclude .git,docs/*
29+
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
30+
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
31+
- name: Blacken
32+
run: black . --check
33+
34+
test-install:
35+
runs-on: ubuntu-latest
36+
steps:
37+
- uses: actions/checkout@v2
38+
- name: Set up Python
39+
uses: actions/setup-python@v2
40+
with:
41+
python-version: 3.9
42+
- name: Install Cloudside
43+
run: |
44+
python -m pip install --upgrade pip
45+
pip install .
46+
- name: Check basic functionality
47+
run: |
48+
cloudside get-asos KPDX 2020-01-01 2020-02-01 [email protected]
49+
50+
test-python:
51+
runs-on: ubuntu-latest
52+
strategy:
53+
matrix:
54+
python-version: ["3.8", "3.9", "3.10"]
55+
steps:
56+
- uses: actions/checkout@v2
57+
- name: Set up Python ${{ matrix.python-version }}
58+
uses: actions/setup-python@v2
59+
with:
60+
python-version: ${{ matrix.python-version }}
61+
- name: Install dependencies
62+
run: |
63+
python -m pip install --upgrade pip
64+
pip install .[dev]
65+
- name: Test with pytest
66+
run: |
67+
pytest -v
68+
69+
test-python-mpl:
70+
runs-on: ubuntu-latest
71+
steps:
72+
- uses: actions/checkout@v2
73+
- name: Set up Python
74+
uses: actions/setup-python@v2
75+
with:
76+
python-version: 3.9
77+
- name: Install dependencies
78+
run: |
79+
python -m pip install --upgrade pip
80+
pip install .[dev]
81+
- name: Test with pytest and check images
82+
run: |
83+
pytest --mpl
84+
85+
coverage:
86+
runs-on: ubuntu-latest
87+
steps:
88+
- uses: actions/checkout@v2
89+
- name: Setup Python
90+
uses: actions/setup-python@v2
91+
with:
92+
python-version: 3.9
93+
- name: Generate coverage report
94+
run: |
95+
python -m pip install --upgrade pip
96+
pip install .[dev]
97+
coverage run -m pytest --doctest-modules --cov-report=xml
98+
- name: Upload coverage to Codecov
99+
uses: codecov/codecov-action@v1
100+
with:
101+
flags: unittests
102+
name: codecov-umbrella
103+
fail_ci_if_error: true
104+
path_to_write_report: ./codecov_report.gz

0 commit comments

Comments
 (0)