|
1 | 1 | name: lint_python |
2 | 2 | on: [pull_request, push] |
3 | 3 | jobs: |
4 | | - lint_python: |
| 4 | + lint: |
5 | 5 | runs-on: ubuntu-latest |
| 6 | + strategy: |
| 7 | + fail-fast: false |
| 8 | + matrix: |
| 9 | + python: ['3.10'] |
6 | 10 | steps: |
7 | 11 | - uses: actions/checkout@v3 |
8 | 12 | - uses: actions/setup-python@v4 |
9 | 13 | with: |
10 | | - python-version: 3.x |
| 14 | + # This allows the matrix to specify just the major.minor version while still |
| 15 | + # expanding it to get the latest patch version including alpha releases. |
| 16 | + # This avoids the need to update for each new alpha, beta, release candidate, |
| 17 | + # and then finally an actual release version. actions/setup-python doesn't |
| 18 | + # support this for PyPy presently so we get no help there. |
| 19 | + # |
| 20 | + # CPython -> 3.9.0-alpha - 3.9.X |
| 21 | + # PyPy -> pypy-3.7 |
| 22 | + python-version: ${{ fromJSON(format('["{0}", "{1}"]', format('{0}.0-alpha - {0}.X', matrix.python), matrix.python))[startsWith(matrix.python, 'pypy')] }} |
| 23 | + architecture: x64 |
11 | 24 | - run: pip install --upgrade pip wheel |
12 | 25 | - run: pip install bandit black codespell flake8 flake8-2020 flake8-bugbear |
13 | | - flake8-comprehensions isort mypy pytest pyupgrade safety |
| 26 | + flake8-comprehensions isort mypy pytest pyupgrade |
14 | 27 | - run: bandit --recursive --skip B101,B102,B307,B404,B603,B607 . |
15 | 28 | - run: black --check . || true |
16 | 29 | - run: codespell # --ignore-words-list="" --skip="*.css,*.js,*.lock" |
|
22 | 35 | - run: pip install numpy pylab-sdk |
23 | 36 | - run: mkdir --parents --verbose .mypy_cache |
24 | 37 | - run: mypy --ignore-missing-imports --install-types --non-interactive . || true |
25 | | - - run: make test |
26 | 38 | - run: shopt -s globstar && pyupgrade --py36-plus **/*.py || true |
27 | | - - run: safety check |
| 39 | + |
| 40 | + test: |
| 41 | + runs-on: ubuntu-latest |
| 42 | + strategy: |
| 43 | + fail-fast: false |
| 44 | + matrix: |
| 45 | + python: ['3.7', '3.8', '3.9', '3.10', '3.11'] |
| 46 | + steps: |
| 47 | + - uses: actions/checkout@v3 |
| 48 | + - uses: actions/setup-python@v4 |
| 49 | + with: |
| 50 | + # This allows the matrix to specify just the major.minor version while still |
| 51 | + # expanding it to get the latest patch version including alpha releases. |
| 52 | + # This avoids the need to update for each new alpha, beta, release candidate, |
| 53 | + # and then finally an actual release version. actions/setup-python doesn't |
| 54 | + # support this for PyPy presently so we get no help there. |
| 55 | + # |
| 56 | + # CPython -> 3.9.0-alpha - 3.9.X |
| 57 | + # PyPy -> pypy-3.7 |
| 58 | + python-version: ${{ fromJSON(format('["{0}", "{1}"]', format('{0}.0-alpha - {0}.X', matrix.python), matrix.python))[startsWith(matrix.python, 'pypy')] }} |
| 59 | + architecture: x64 |
| 60 | + - run: pip install --upgrade pip wheel |
| 61 | + - run: pip install pytest safety |
| 62 | + - run: pip install --editable . |
| 63 | + - run: pip install numpy pylab-sdk |
| 64 | + - run: make test |
| 65 | + - if: matrix.python != '3.7' |
| 66 | + run: safety check |
0 commit comments