-
Notifications
You must be signed in to change notification settings - Fork 8
80 lines (74 loc) · 2.63 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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
name: Reusable workflow that runs all tests
on:
workflow_call:
inputs:
python-version:
type: string
required: true
platform:
type: string
required: true
skip-coverage:
type: boolean
required: false
default: false
permissions:
contents: read
env:
# Environment variables to support color support (jaraco/skeleton#66):
# Request colored output from CLI tools supporting it. Different tools
# interpret the value differently. For some, just being set is sufficient.
# For others, it must be a non-zero integer. For yet others, being set
# to a non-empty value is sufficient. For tox, it must be one of
# <blank>, 0, 1, false, no, off, on, true, yes. The only enabling value
# in common is "1".
FORCE_COLOR: 1
# Recognized by the `py` package, dependency of `pytest` (must be "1")
PY_COLORS: 1
# Suppress noisy pip warnings
PIP_DISABLE_PIP_VERSION_CHECK: 'true'
PIP_NO_PYTHON_VERSION_WARNING: 'true'
PIP_NO_WARN_SCRIPT_LOCATION: 'true'
jobs:
test:
runs-on: ${{ inputs.platform }}
steps:
- uses: actions/checkout@v3
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: ${{ inputs.python-version }}
allow-prereleases: true
- name: Sanity check
run: |
which python
python --version
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install flake8 pytest pytest-cov coverage toml pint
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
- name: Install coverage-lcov
if: ${{ !inputs.skip-coverage }}
run: |
pip install coverage-lcov
- name: Lint with flake8
run: |
# stop the build if there are Python syntax errors or undefined names
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings.
flake8 . --count --exit-zero --max-complexity=10 --statistics
- name: Test with py.test (with coverage)
if: ${{ !inputs.skip-coverage }}
run: |
python -m pytest --cov=aioax25 --cov-report=term-missing --cov-report=lcov
- name: Test with py.test (without lcov coverage)
if: ${{ inputs.skip-coverage }}
run: |
python -m pytest --cov=aioax25 --cov-report=term-missing
- name: Coveralls
if: ${{ !inputs.skip-coverage }}
uses: coverallsapp/github-action@master
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
path-to-lcov: ./coverage.lcov