forked from tier4/otaclient-iot-logging-server
-
Notifications
You must be signed in to change notification settings - Fork 0
89 lines (75 loc) · 2.31 KB
/
test.yaml
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
81
82
83
84
85
86
87
88
89
name: test CI
on: [pull_request]
jobs:
pytest_with_coverage_on_supported_os:
strategy:
fail-fast: true
matrix:
# currently we only need to ensure it is running on the following OS
# with OS-shipped python interpreter.
os: ["ubuntu-20.04", "ubuntu-22.04"]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout commit
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
cache: "pip"
- name: Install package
run: |
python -m pip install -q -U pip
pip install -q .[dev]
- name: Execute pytest with coverage
run: |
coverage run -m pytest --junit-xml=test_result/pytest.xml
coverage xml -o test_result/coverage.xml
# export the coverage report to the comment!
- name: Add coverage report to PR comment
continue-on-error: true
uses: MishaKav/[email protected]
with:
pytest-xml-coverage-path: test_result/coverage.xml
junitxml-path: test_result/pytest.xml
pytest_on_supported_python_vers:
runs-on: ubuntu-22.04
strategy:
fail-fast: true
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11"]
steps:
- name: Checkout commit
uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: "pip"
- name: Install package
run: |
python -m pip install -q -U pip
pip install -q .[dev]
- name: Execute pytest
run: pytest
python_lint_check:
runs-on: ubuntu-22.04
timeout-minutes: 3
strategy:
fail-fast: true
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11"]
steps:
- name: Checkout commit
uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install check dependencies
run: |
python -m pip install -q -U pip
pip install -q .[dev]
- name: Check code linting
run: |
black --check src
flake8 src