-
Notifications
You must be signed in to change notification settings - Fork 0
84 lines (78 loc) · 2.65 KB
/
static-checks-and-unit-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
name: Static checks and unit tests
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
test-linux:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.12]
steps:
- uses: actions/checkout@v2
- name: Update APT cache
run: sudo apt-get update
- name: Install graphviz for class and package diagrams
run: sudo apt-get install graphviz
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install wheel
pip install -r requirements/test.txt
- name: Static type checking with mypy
run: python dev-tools/dev_tools.py --type
- name: Lint with pylint
run: python dev-tools/dev_tools.py --lint --keep-results
- name: Generate class and package diagrams
run: |
python dev-tools/dev_tools.py --diagram --keep-results
- name: Test with pytest
run: python dev-tools/dev_tools.py --unit "not manual and not windows and not tool" --keep-results
- name: Build documentation
run: python dev-tools/dev_tools.py --doc
- name: Upload test results and coverage reports
uses: actions/upload-artifact@v2
with:
name: pytrnsys-process-build-artifacts-linux
path: |
test-results
doc/_build
test-windows:
runs-on:
- self-hosted
- spf-windows-gh-runners
steps:
- uses: actions/checkout@v2
- name: Remove old venv
run: |
if (Test-Path -LiteralPath venv) {
Remove-Item -LiteralPath venv -Recurse
}
- name: Create virtual environment
run: py -3.12 -m venv venv
- name: Install dependencies
run: |
venv\Scripts\python -m pip install --upgrade pip
venv\Scripts\python -m pip install wheel
venv\Scripts\python -m pip install -r requirements/test.txt
- name: Static type checking with mypy
run: venv\Scripts\python dev-tools\dev_tools.py --type
- name: Lint with pylint
run: venv\Scripts\python dev-tools\dev_tools.py --lint --keep-results
- name: Test with pytest
run: venv\Scripts\python dev-tools\dev_tools.py --unit "not manual and not linux and not tool" --keep-results
- name: Build documentation
run: venv\Scripts\python dev-tools\dev_tools.py --doc
- name: Upload test results and coverage reports
uses: actions/upload-artifact@v2
with:
name: pytrnsys-process-build-artifacts-windows
path: |
test-results
doc/_build