-
-
Notifications
You must be signed in to change notification settings - Fork 1
102 lines (100 loc) · 3.08 KB
/
python-ci.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
name: Python CI
on: [push]
jobs:
style:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest]
python-version: ['3.11']
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.os }} ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip setuptools wheel
pip install -Ur requirements_test.txt
- name: Check PyCodeStyle
run: |
pycodestyle --statistics --count pyerge
- name: Check PyDocStyle
run: |
pydocstyle --count pyerge
- name: Check interrogate
run: |
interrogate -c pyproject.toml -vv
- name: Check PyLint
run: |
pylint pyerge || echo $(($? % 4))
- name: Check flake8
run: |
flake8 . --select=E9,F63,F7,F82 --show-source
flake8 . --exit-zero --ignore=E501
- name: Check MANIFEST
run: |
check-manifest -q || echo $(($? -1))
test:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest]
python-version: ['3.7', '3.8', '3.9', '3.10']
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.os }} ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip setuptools wheel
pip install -Ur requirements_test.txt
- name: Test with pytest
run: |
python -m pytest
coverage:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest]
python-version: ['3.11']
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.os }} ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip setuptools wheel
pip install -Ur requirements_test.txt
- name: Check mypy
run: |
mypy pyerge # || echo $(($? - 1))
- name: Test with pytest
run: |
python -m pytest --cov=pyerge --cov-report=xml --cov-report=html --cov-report=term
- name: Upload pytest and mypy results
uses: actions/upload-artifact@v3
if: always()
with:
name: test_mypy-${{ matrix.os }}-py${{ matrix.python-version }}
path: |
htmlcov/*
mypyhtml/*
coverage.xml
retention-days: 4
- name: Run codacy-coverage
env:
CODACY_PROJECT_TOKEN: ${{ secrets.CODACY_PROJECT_TOKEN }}
run: |
python-codacy-coverage -r coverage.xml
- name: Test Coveralls
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
COVERALLS_SERVICE_NAME: github
run: |
coveralls