|
| 1 | +name: Tests |
| 2 | + |
| 3 | +on: [push, pull_request] |
| 4 | + |
| 5 | +env: |
| 6 | + PY_COLORS: "1" |
| 7 | + |
| 8 | +jobs: |
| 9 | + test: |
| 10 | + runs-on: ${{ matrix.os }} |
| 11 | + continue-on-error: ${{ matrix.experimental }} # See: https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions#jobsjob_idcontinue-on-error |
| 12 | + strategy: |
| 13 | + matrix: |
| 14 | + os: [ubuntu-latest, macos-latest, windows-latest] |
| 15 | + experimental: [false] |
| 16 | + python-version: ["3.7", "3.8", "3.9", "3.10", "pypy-3.7", "pypy-3.8"] |
| 17 | + # Do not test on Python 3.11 pre-releases since wrapt causes problems: https://github.com/GrahamDumpleton/wrapt/issues/196 |
| 18 | + # include: |
| 19 | + # Only test on a single configuration while there are just pre-releases |
| 20 | + # - os: ubuntu-latest |
| 21 | + # experimental: true |
| 22 | + # python-version: "3.11.0-alpha.3" |
| 23 | + fail-fast: false |
| 24 | + steps: |
| 25 | + - uses: actions/checkout@v2 |
| 26 | + - name: Set up Python ${{ matrix.python-version }} |
| 27 | + uses: actions/setup-python@v2 |
| 28 | + with: |
| 29 | + python-version: ${{ matrix.python-version }} |
| 30 | + - name: Install dependencies |
| 31 | + run: | |
| 32 | + python -m pip install --upgrade pip |
| 33 | + pip install tox |
| 34 | + - name: Test with pytest via tox |
| 35 | + run: | |
| 36 | + tox -e gh |
| 37 | + - name: Upload coverage to Codecov |
| 38 | + uses: codecov/codecov-action@v2 |
| 39 | + with: |
| 40 | + fail_ci_if_error: true |
| 41 | + |
| 42 | + static-code-analysis: |
| 43 | + runs-on: ubuntu-latest |
| 44 | + steps: |
| 45 | + - uses: actions/checkout@v2 |
| 46 | + - name: Set up Python |
| 47 | + uses: actions/setup-python@v2 |
| 48 | + with: |
| 49 | + python-version: "3.10" |
| 50 | + - name: Install dependencies |
| 51 | + run: | |
| 52 | + python -m pip install --upgrade pip |
| 53 | + pip install -e . |
| 54 | + pip install -r requirements-lint.txt |
| 55 | + - name: mypy 3.7 |
| 56 | + run: | |
| 57 | + mypy --python-version 3.7 . |
| 58 | + - name: mypy 3.8 |
| 59 | + run: | |
| 60 | + mypy --python-version 3.8 . |
| 61 | + - name: mypy 3.9 |
| 62 | + run: | |
| 63 | + mypy --python-version 3.9 . |
| 64 | + - name: mypy 3.10 |
| 65 | + run: | |
| 66 | + mypy --python-version 3.10 . |
| 67 | + - name: pylint |
| 68 | + run: | |
| 69 | + pylint --rcfile=.pylintrc \ |
| 70 | + can/**.py \ |
| 71 | + setup.py \ |
| 72 | + doc.conf \ |
| 73 | + scripts/**.py \ |
| 74 | + examples/**.py |
| 75 | +
|
| 76 | + format: |
| 77 | + runs-on: ubuntu-latest |
| 78 | + steps: |
| 79 | + - uses: actions/checkout@v2 |
| 80 | + - name: Set up Python |
| 81 | + uses: actions/setup-python@v2 |
| 82 | + with: |
| 83 | + python-version: "3.10" |
| 84 | + - name: Install dependencies |
| 85 | + run: | |
| 86 | + python -m pip install --upgrade pip |
| 87 | + pip install -r requirements-lint.txt |
| 88 | + - name: Code Format Check with Black |
| 89 | + run: | |
| 90 | + black --check --verbose . |
0 commit comments