-
-
Notifications
You must be signed in to change notification settings - Fork 198
77 lines (64 loc) · 2.25 KB
/
system-monitor-windows.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
name: System monitor (Windows)
on:
push:
branches:
- main
- 'releases/**'
pull_request:
jobs:
system-monitor:
runs-on: windows-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.8", "3.12"]
theme: [ "3.5inchTheme2" ]
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install -r requirements.txt
- name: Configure system monitor
run: |
# For tests there is no real HW: use simulated LCD mode
(Get-Content config.yaml) -replace "^ REVISION.*$"," REVISION: SIMU" | Set-Content config.yaml
# Setup selected theme in config.yaml
echo "Using theme ${{ matrix.theme }}"
(Get-Content config.yaml) -replace "^ THEME.*$"," THEME: ${{ matrix.theme }}" | Set-Content config.yaml
- name: Run system monitor for 20 seconds
run: |
Start-Process -NoNewWindow python3 main.py -RedirectStandardOutput output.log -RedirectStandardError error.log
sleep 20
add-content output.log (get-content error.log)
- name: Check output for errors
run: |
echo "######## Output : ########"
cat output.log
$SEL = Select-String -Path output.log -Pattern "error"
if ($SEL -ne $null)
{
throw "Program failed to run, see output above"
}
$SEL = Select-String -Path output.log -Pattern "traceback"
if ($SEL -ne $null)
{
throw "Program failed to run, see output above"
}
$SEL = Select-String -Path output.log -Pattern "exception"
if ($SEL -ne $null)
{
throw "Program failed to run, see output above"
}
- name: Prepare screenshot for archiving
run: |
cp screencap.png screenshot-py${{ matrix.python-version }}-${{ matrix.theme }}.png
- name: Archive a screenshot
uses: actions/upload-artifact@v4
with:
name: screenshot-py${{ matrix.python-version }}-${{ matrix.theme }}
path: screenshot-*.png