50 lines (42 loc) · 1.46 KB
/
tests.yaml
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
name: Run tests
on:
- push
- workflow_call
jobs:
tests:
name: Run all tests
runs-on: ubuntu-latest
strategy:
matrix:
python_version: ["3.7", "3.8", "3.9", "3.10", "3.11", "pypy-3.7", "pypy-3.9"]
coverage_fail_under: [90]
include:
# https://github.com/nedbat/coveragepy/issues/1515
# https://foss.heptapod.net/pypy/pypy/-/issues/3876
- python_version: "pypy-3.8"
coverage_fail_under: 0
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Setup python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python_version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip setuptools wheel
python -m pip install .
python -m pip install -r test_requirements.txt
- name: Run unittests
run: python -m pytest --cov-fail-under=${{ matrix.coverage_fail_under }}
- name: Verify dependencies
run: python -m safety check
- name: Verify code style
run: python -m flake8 -v
- name: Verify type annotations
# Installation of typed-ast on pypy-3.7 is broken
# We re-install mypy here for the other pypy's which don't get mypy from requirements file.
if: ${{ matrix.python_version != 'pypy-3.7' }}
run: |
python -m pip install mypy
python -m mypy --config mypy.ini mollie/