|
| 1 | +# This workflow will install Python dependencies, run tests and lint with a single version of Python |
| 2 | +# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions |
| 3 | + |
| 4 | +name: Test and Lint |
| 5 | + |
| 6 | +on: [push] |
| 7 | + |
| 8 | +jobs: |
| 9 | + Pytest: |
| 10 | + runs-on: ubuntu-latest |
| 11 | + steps: |
| 12 | + - uses: actions/checkout@v3 |
| 13 | + with: |
| 14 | + submodules: 'recursive' |
| 15 | + - name: Set up Python 3.11 |
| 16 | + uses: actions/setup-python@v4 |
| 17 | + with: |
| 18 | + python-version: 3.11 |
| 19 | + - uses: Gr1N/setup-poetry@v8 |
| 20 | + - uses: actions/cache@v2 |
| 21 | + with: |
| 22 | + path: ~/.cache/pypoetry/virtualenvs |
| 23 | + key: ${{ runner.os }}-poetry-${{ hashFiles('poetry.lock') }} |
| 24 | + - run: poetry --version |
| 25 | + - run: poetry install |
| 26 | + - name: Test with pytest |
| 27 | + run: | |
| 28 | + poetry run coverage run -m pytest |
| 29 | + - name: Generate code coverage report |
| 30 | + run: | |
| 31 | + poetry run coverage report |
| 32 | +
|
| 33 | + Flake8: |
| 34 | + runs-on: ubuntu-latest |
| 35 | + steps: |
| 36 | + - uses: actions/checkout@v3 |
| 37 | + with: |
| 38 | + submodules: 'recursive' |
| 39 | + - name: Set up Python 3.11 |
| 40 | + uses: actions/setup-python@v4 |
| 41 | + with: |
| 42 | + python-version: 3.11 |
| 43 | + - uses: Gr1N/setup-poetry@v8 |
| 44 | + - uses: actions/cache@v2 |
| 45 | + with: |
| 46 | + path: ~/.cache/pypoetry/virtualenvs |
| 47 | + key: ${{ runner.os }}-poetry-${{ hashFiles('poetry.lock') }} |
| 48 | + - run: poetry --version |
| 49 | + - run: poetry install |
| 50 | + - name: Lint with flake8 |
| 51 | + run: | |
| 52 | + poetry run flake8 |
| 53 | +
|
| 54 | + Mypy: |
| 55 | + runs-on: ubuntu-latest |
| 56 | + steps: |
| 57 | + - uses: actions/checkout@v3 |
| 58 | + with: |
| 59 | + submodules: 'recursive' |
| 60 | + - name: Set up Python 3.11 |
| 61 | + uses: actions/setup-python@v4 |
| 62 | + with: |
| 63 | + python-version: 3.11 |
| 64 | + - uses: Gr1N/setup-poetry@v8 |
| 65 | + - uses: actions/cache@v2 |
| 66 | + with: |
| 67 | + path: ~/.cache/pypoetry/virtualenvs |
| 68 | + key: ${{ runner.os }}-poetry-${{ hashFiles('poetry.lock') }} |
| 69 | + - run: poetry --version |
| 70 | + - run: poetry install |
| 71 | + - name: Lint with mypy |
| 72 | + run: | |
| 73 | + poetry run mypy . |
0 commit comments