|
| 1 | +# This workflow will install Python dependencies, run tests and lint with a single version of Python |
| 2 | +# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python |
| 3 | + |
| 4 | +name: Python application |
| 5 | + |
| 6 | +on: pull_request |
| 7 | + |
| 8 | +permissions: |
| 9 | + contents: read |
| 10 | + |
| 11 | +jobs: |
| 12 | + validate_unix: |
| 13 | + |
| 14 | + runs-on: ubuntu-latest |
| 15 | + strategy: |
| 16 | + matrix: |
| 17 | + python-version: ["3.8", "3.9"] |
| 18 | + steps: |
| 19 | + - name: checkout |
| 20 | + uses: actions/checkout@v3 |
| 21 | + |
| 22 | + - name: Set up Python ${{ matrix.python-version }} |
| 23 | + uses: actions/setup-python@v3 |
| 24 | + with: |
| 25 | + python-version: ${{ matrix.python-version }} |
| 26 | + |
| 27 | + - name: Install dependencies |
| 28 | + run: | |
| 29 | + python -m pip install --upgrade pip |
| 30 | + python -m pip install -e . |
| 31 | + python -m pip install -r requirements-dev.txt |
| 32 | + |
| 33 | + - name: check pylint |
| 34 | + run: pylint JSONLibrary --disable=R,C,W0703,W0212,W1203 |
| 35 | + |
| 36 | + - name: check doc generation |
| 37 | + run: python -m robot.libdoc JSONLibrary docs/JSONLibrary.html |
| 38 | + |
| 39 | + - name: check black |
| 40 | + run: black . --check --diff |
| 41 | + |
| 42 | + - name: Lint with flake8 |
| 43 | + run: | |
| 44 | + # stop the build if there are Python syntax errors or undefined names |
| 45 | + flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics |
| 46 | + # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide |
| 47 | + flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics |
| 48 | +
|
| 49 | + - name: validate |
| 50 | + run: | |
| 51 | + pytest --cov-config=tests/.coveragerc --cov --cov-report term tests/ |
| 52 | + coverage xml --rcfile tests/.coveragerc |
| 53 | + coverage html --rcfile tests/.coveragerc |
| 54 | + robot -d tests/__out__/robot acceptance/ |
| 55 | +
|
| 56 | + validate_windows: |
| 57 | + |
| 58 | + runs-on: windows-latest |
| 59 | + strategy: |
| 60 | + matrix: |
| 61 | + python-version: ["3.10", "3.11"] |
| 62 | + steps: |
| 63 | + - name: checkout |
| 64 | + uses: actions/checkout@v3 |
| 65 | + |
| 66 | + - name: Set up Python ${{ matrix.python-version }} |
| 67 | + uses: actions/setup-python@v3 |
| 68 | + with: |
| 69 | + python-version: ${{ matrix.python-version }} |
| 70 | + |
| 71 | + - name: Install dependencies |
| 72 | + run: | |
| 73 | + python -m pip install --upgrade pip |
| 74 | + python -m pip install -e . |
| 75 | + python -m pip install -r requirements-dev.txt |
| 76 | + |
| 77 | + - name: validate |
| 78 | + run: | |
| 79 | + pytest --cov-config=tests/.coveragerc --cov --cov-report term tests/ |
| 80 | + coverage xml --rcfile tests/.coveragerc |
| 81 | + coverage html --rcfile tests/.coveragerc |
| 82 | + robot -d tests/__out__/robot acceptance/ |
0 commit comments