-
Notifications
You must be signed in to change notification settings - Fork 1
107 lines (97 loc) · 3.25 KB
/
tests.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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
# This workflow will install Python dependencies, run tests and lint with a single version of Python
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
name: "Tests"
on:
push:
branches: [ dev, master ]
paths:
- '**.py'
- 'pkg_lifeblood/pyproject.toml'
- 'pkg_lifeblood/setup.cfg'
- 'pkg_lifeblood_viewer/pyproject.toml'
- 'pkg_lifeblood_viewer/setup.cfg'
- '.github/workflows/tests.yml'
pull_request:
branches: [ dev, master ]
paths:
- '**.py'
- 'pkg_lifeblood/pyproject.toml'
- 'pkg_lifeblood/setup.cfg'
- 'pkg_lifeblood_viewer/pyproject.toml'
- 'pkg_lifeblood_viewer/setup.cfg'
- '.github/workflows/tests.yml'
jobs:
tests:
name: "Tests Linux"
runs-on: ubuntu-latest
strategy:
matrix:
pyver: ['3.8', '3.9', '3.10']
fail-fast: false
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{matrix.pyver}}
uses: actions/setup-python@v5
with:
python-version: ${{matrix.pyver}}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install flake8 pytest pytest-timeout
cd pkg_lifeblood
pip install .
cd ..
- name: Adjust PYTHONPATH
run: echo "PYTHONPATH=$PYTHOPATH:./src" >> $GITHUB_ENV
- name: what net is this
run: ip addr show
- name: Test with pytest
run: pytest --timeout=180 --durations=10 --junitxml=tests_log_linux_${{matrix.pyver}}.xml
- name: save result
uses: actions/upload-artifact@v4
with:
name: tests-report_lin_${{matrix.pyver}}
path: tests_log_linux_${{matrix.pyver}}.xml
if: ${{ always() }}
timeout-minutes: 20
tests_windows:
name: "Tests Windows"
runs-on: windows-latest
strategy:
matrix:
pyver: [ '3.9', '3.10' ]
fail-fast: false
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{matrix.pyver}}
uses: actions/setup-python@v5
with:
python-version: ${{matrix.pyver}}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install flake8 pytest pytest-timeout
cd pkg_lifeblood
pip install .
cd ..
shell: bash
- name: Adjust PYTHONPATH
run: echo PYTHONPATH=%PYTHOPATH%;%cd%\src >> %GITHUB_ENV%
shell: cmd
# - 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. The GitHub editor is 127 chars wide
# flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
- name: Test with pytest
run: |
pytest --timeout=180 --durations=10 --junitxml=tests_log_win_${{matrix.pyver}}.xml
shell: bash
- name: save result
uses: actions/upload-artifact@v4
with:
name: tests-report_win_${{matrix.pyver}}
path: tests_log_win_${{matrix.pyver}}.xml
if: ${{ always() }}
timeout-minutes: 30