|
| 1 | +# This workflow will install Python dependencies, run tests and lint with a variety of Python versions |
| 2 | +# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python |
| 3 | + |
| 4 | +name: pynmea2 |
| 5 | +on: |
| 6 | + push: |
| 7 | + branches: ["master"] |
| 8 | + pull_request: |
| 9 | + branches: ["master"] |
| 10 | + |
| 11 | +jobs: |
| 12 | + test: |
| 13 | + runs-on: ${{ matrix.os }} |
| 14 | + strategy: |
| 15 | + fail-fast: false |
| 16 | + matrix: |
| 17 | + python: ["3"] |
| 18 | + os: ["ubuntu-latest"] |
| 19 | + include: |
| 20 | + - {python: "3.8", os: "ubuntu-22.04"} |
| 21 | + - {python: "3.9", os: "ubuntu-22.04"} |
| 22 | + - {python: "3.10", os: "ubuntu-22.04"} |
| 23 | + - {python: "3.11", os: "ubuntu-22.04"} |
| 24 | + steps: |
| 25 | + - uses: actions/checkout@v3 |
| 26 | + - name: Set up Python ${{ matrix.python }} |
| 27 | + uses: actions/setup-python@v3 |
| 28 | + with: |
| 29 | + python-version: ${{ matrix.python }} |
| 30 | + - name: Install dependencies |
| 31 | + run: | |
| 32 | + python -m pip install --upgrade pip |
| 33 | + python -m pip install pytest |
| 34 | + python -m pip install flake8 |
| 35 | + python -m pip install importlib_metadata |
| 36 | + - name: Lint with flake8 |
| 37 | + run: | |
| 38 | + # stop the build if there are Python syntax errors or undefined names |
| 39 | + flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics |
| 40 | + flake8 . --count --exit-zero --max-complexity=10 --max-line-length=80 --statistics |
| 41 | + - name: Build and test |
| 42 | + run: | |
| 43 | + python setup.py sdist --formats=zip |
| 44 | + pip install dist/pynmea2*.zip |
| 45 | + pytest |
| 46 | + - name: Coveralls |
| 47 | + env: |
| 48 | + COVERAGE_RCFILE: ".github/workflows/.coveragerc" |
| 49 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 50 | + run: | |
| 51 | + python -m pip install "coverage" |
| 52 | + python -m pip install "coveralls" |
| 53 | + coverage run --source=pynmea2 -m pytest |
| 54 | + python -m coveralls --service=github || true |
0 commit comments