-
Notifications
You must be signed in to change notification settings - Fork 5
39 lines (36 loc) · 1.28 KB
/
test.yml
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
name: Build and test package
on:
push:
branches:
- master
pull_request:
jobs:
build:
name: Test with ${{matrix.python-version}} on Ubuntu
runs-on: ubuntu-latest
strategy:
max-parallel: 4
matrix:
python: ["3.10", "3.11", "3.12"]
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install poetry flake8
poetry install --with dev
- name: Lint with Flake8
run: |
# stop the build if there are Python syntax errors or undefined names
flake8 freesif/ --count --select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
flake8 freesif/ --count --exit-zero --per-file-ignores=__init__.py:F401 --max-complexity=10 --max-line-length=127 --statistics
- name: Test and report coverage
run: |
# List terminal lines with missing test
poetry run pytest -s tests/ --cov=freesif --cov-report=term-missing
# future: add --cov-fail-under=95 to fail if coverage is less than 95%