This repository has been archived by the owner on Feb 14, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
112 lines (99 loc) · 2.91 KB
/
pythonpackage.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
name: Unit tests
on:
push:
branches:
- master
pull_request:
jobs:
lint:
if: "!contains(github.event.head_commit.message, 'skip ci')"
strategy:
matrix:
python-version: [3.7, 3.8]
os: [ubuntu-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v1
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install flake8
- name: Lint w/ flake8 - syntax error or undefined names
run: |
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
- name: Lint w/ flake8 - all
continue-on-error: true
run: |
flake8 . --count --max-complexity=10 --max-line-length=127 --statistics
test:
if: "!contains(github.event.head_commit.message, 'skip ci')"
needs: lint
strategy:
matrix:
python-version: [3.7, 3.8]
os: [ubuntu-latest, windows-latest, macOS-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v1
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
pip install -r requirements-dev.txt
pip install -e .
- name: Test w/ pytest
run: |
pytest
- name: Code coverage
uses: codecov/codecov-action@v1.0.5
with:
token: ${{ secrets.CODECOV_TOKEN }}
flags: unittests
style:
if: "!contains(github.event.head_commit.message, 'skip ci')"
strategy:
matrix:
python-version: [3.7, 3.8]
os: [ubuntu-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v1
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install black toml
- name: Format source w/ black
# fail when file(s) would be formatted
run: black --check .
type-hints:
if: "!contains(github.event.head_commit.message, 'skip ci')"
strategy:
matrix:
python-version: [3.7, 3.8]
os: [ubuntu-latest]
runs-on: ${{ matrix.os }}
continue-on-error: true
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v1
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install mypy{,_extensions}
- name: Type check w/ mypy
run: mypy --pretty