-
-
Notifications
You must be signed in to change notification settings - Fork 210
71 lines (59 loc) · 1.99 KB
/
simple-program-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
name: Simple program (Windows)
on:
push:
branches:
- main
- 'releases/**'
pull_request:
jobs:
simple-program:
runs-on: windows-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.8", "3.12"]
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: Run simple-program.py during 20 seconds
run: |
# For tests there is no real HW: use simulated LCD mode
(Get-Content simple-program.py) -replace "^REVISION.*$","REVISION=`"SIMU`"" | Set-Content simple-program.py
# Run the program for 20s
Start-Process -NoNewWindow python3 simple-program.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 }}.png
- name: Archive a screenshot
uses: actions/upload-artifact@v4
with:
name: screenshot-py${{ matrix.python-version }}
path: screenshot-*.png