|
| 1 | +name: Install, test, doctest, lint, typecheck ncls |
| 2 | + |
| 3 | +# Source: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python#using-multiple-python-versions |
| 4 | + |
| 5 | +on: [pull_request, workflow_dispatch] |
| 6 | + |
| 7 | +jobs: |
| 8 | + install_and_test: |
| 9 | + runs-on: ubuntu-latest |
| 10 | + strategy: |
| 11 | + # You can use PyPy versions in python-version. |
| 12 | + # For example, pypy2.7 and pypy3.9 |
| 13 | + matrix: |
| 14 | + python-version: ["3.7", "3.8", "3.9", "3.10", "3.11"] |
| 15 | + |
| 16 | + steps: |
| 17 | + - uses: actions/checkout@v3 |
| 18 | + - name: Set up Python ${{ matrix.python-version }} |
| 19 | + uses: actions/setup-python@v4 |
| 20 | + with: |
| 21 | + python-version: ${{ matrix.python-version }} |
| 22 | + - run: |
| 23 | + pip install pytest |
| 24 | + - name: Install |
| 25 | + run: | |
| 26 | + pip install . |
| 27 | + pytest tests/*.py |
| 28 | +
|
| 29 | + isort: |
| 30 | + runs-on: ubuntu-latest |
| 31 | + steps: |
| 32 | + - uses: actions/checkout@v3 |
| 33 | + - name: Set up Python environment |
| 34 | + uses: actions/setup-python@v4 |
| 35 | + with: |
| 36 | + python-version: "3.11" |
| 37 | + - run: pip install isort |
| 38 | + - run: isort --profile black -l 120 --check --diff ncls tests |
| 39 | + |
| 40 | + black: |
| 41 | + runs-on: ubuntu-latest |
| 42 | + steps: |
| 43 | + - uses: actions/checkout@v3 |
| 44 | + - name: Set up Python environment |
| 45 | + uses: actions/setup-python@v4 |
| 46 | + with: |
| 47 | + python-version: "3.11.0" |
| 48 | + - run: pip install black |
| 49 | + - run: black -l 120 --check --diff ncls tests |
| 50 | + |
| 51 | + flake8: |
| 52 | + runs-on: ubuntu-latest |
| 53 | + name: Lint |
| 54 | + steps: |
| 55 | + - name: Check out source repository |
| 56 | + uses: actions/checkout@v3 |
| 57 | + - name: Set up Python environment |
| 58 | + uses: actions/setup-python@v4 |
| 59 | + - name: flake8 Lint install |
| 60 | + run: pip install flake8 |
| 61 | + - name: flake8 Lint |
| 62 | + run: flake8 --max-line-length=120 --ignore E203,E501,W503 ncls tests |
| 63 | + |
| 64 | + mypy: |
| 65 | + runs-on: ubuntu-latest |
| 66 | + name: Mypy |
| 67 | + steps: |
| 68 | + - name: Check out source repository |
| 69 | + uses: actions/checkout@v3 |
| 70 | + - name: Set up Python environment |
| 71 | + uses: actions/setup-python@v4 |
| 72 | + with: |
| 73 | + python-version: "3.11" |
| 74 | + - name: Install mypy |
| 75 | + run: pip install mypy |
| 76 | + - name: mypy |
| 77 | + run: | |
| 78 | + pip install numpy # for the typing stubs |
| 79 | + python -m pip install pandas-stubs types-setuptools |
| 80 | + mypy ncls |
0 commit comments