9
9
jobs :
10
10
test :
11
11
name : Testing on
12
- runs-on : ${{ matrix.os }}
12
+ runs-on : " ubuntu-latest "
13
13
strategy :
14
14
matrix :
15
15
python-version : ["3.12", "3.11", "3.10", 3.9, 3.8, pypy-3.9]
16
- os : ["ubuntu-22.04"]
17
- include :
18
- - os : " ubuntu-latest"
19
- python-version : 3.11
20
16
steps :
21
17
- uses : actions/checkout@v4
22
18
- name : Set up Python
@@ -27,39 +23,36 @@ jobs:
27
23
uses : actions/cache@v3
28
24
with :
29
25
path : ~/.cache/pip
30
- key : ${{ runner.os }}-pip-${{ matrix.python-version }}-${{ hashFiles('requirements.txt ') }}
26
+ key : ${{ runner.os }}-pip-${{ matrix.python-version }}-${{ hashFiles('tox.ini ') }}
31
27
restore-keys : |
32
28
${{ runner.os }}-pip-${{ matrix.python-version }}-
33
- - name : pip version
34
- run : pip --version
35
29
- name : Install dependencies
36
- if : matrix.python-version == '3.9'
37
- run : python -m pip install -r requirements-lint.txt
38
- - name : Install dependencies
39
- if : matrix.python-version != '3.9'
40
- run : python -m pip install -r requirements.txt
41
- # formatters
42
- - name : Run pyupgrade
43
- if : matrix.python-version == '3.9'
44
- run : pyupgrade --py37-plus *.py
45
- - name : Run isort
46
- if : matrix.python-version == '3.9'
47
- run : isort --check-only *.py
48
- - name : Run black
49
- if : matrix.python-version == '3.9'
50
- run : black --check --skip-string-normalization *.py
51
- # linters
52
- - name : Lint with bandit
53
- if : matrix.python-version == '3.9'
54
- run : bandit --skip B101 *.py # B101 is assert statements
55
- - name : Lint with codespell
56
- if : matrix.python-version == '3.9'
57
- run : codespell *.rst *.py
58
- - name : Lint with flake8
59
- if : matrix.python-version == '3.9'
60
- run : flake8 *.py --count --max-complexity=18 --max-line-length=88 --show-source --statistics
61
- # tests and coverage
30
+ run : python -m pip install tox
62
31
- name : Test
63
- run : pytest run_tests.py --cov --cov-report term-missing
64
- - name : Coverage
65
- run : coveralls --service=github
32
+ run : tox -e test
33
+
34
+ lint :
35
+ name : Lint code
36
+ runs-on : " ubuntu-latest"
37
+ strategy :
38
+ matrix :
39
+ python-version : [3.8]
40
+ steps :
41
+ - uses : actions/checkout@v4
42
+ - name : Set up Python
43
+ uses : actions/setup-python@v4
44
+ with :
45
+ python-version : ${{ matrix.python-version }}
46
+ - name : Cache packages
47
+ uses : actions/cache@v3
48
+ with :
49
+ path : |
50
+ ~/.cache/pre-commit
51
+ ~/.cache/pip
52
+ key : ${{ runner.os }}-pip-${{ matrix.python-version }}-${{ hashFiles('tox.ini') }}
53
+ restore-keys : |
54
+ ${{ runner.os }}-pip-${{ matrix.python-version }}-
55
+ - name : Install dependencies
56
+ run : python -m pip install tox
57
+ - name : Run linting
58
+ run : tox -e lint
0 commit comments