1+ name : System monitor - themes screenshot
2+
3+ on :
4+ push :
5+ branches :
6+ - main
7+ - ' releases/**'
8+ pull_request :
9+
10+ jobs :
11+ system-monitor :
12+
13+ runs-on : ubuntu-latest
14+
15+ strategy :
16+ fail-fast : false
17+ matrix :
18+ theme : [ "3.5inchTheme2", "Cyberpunk", "Cyberpunk-net", "Landscape6Grid", "Terminal", "bash-dark-green", "bash-dark-green-gpu",
19+ " LandscapeMagicBlue" , "BigClock" ]
20+
21+ steps :
22+ - uses : actions/checkout@v3
23+ - name : Set up Python 3.10
24+ uses : actions/setup-python@v4
25+ with :
26+ python-version : 3.10
27+
28+ - name : Install dependencies
29+ run : |
30+ python -m pip install --upgrade pip
31+ python -m pip install -r requirements.txt
32+
33+ - name : Configure system monitor for screenshot
34+ run : |
35+ # For tests there is no real HW: use simulated LCD mode
36+ sed -i "/REVISION:/c\ REVISION: SIMU" config.yaml
37+
38+ # Use static data
39+ sed -i "/HW_SENSORS:/c\ HW_SENSORS: STATIC" config.yaml
40+
41+ - name : Run system monitor for 5 seconds on all themes
42+ run : |
43+ for dir in res/themes/*/
44+ do
45+ # Remove the trailing "/"
46+ theme=${dir%*/}
47+
48+ # Setup selected theme in config.yaml
49+ echo "Using theme $theme"
50+ sed -i "/THEME:/c\ THEME: $theme" config.yaml
51+
52+ # Run system-monitor for 5 seconds
53+ python3 main.py > output.log 2>&1 &
54+ sleep 5
55+ killall -9 python3
56+
57+ # Rename screen capture
58+ cp screencap.png screenshot-$theme.png
59+ done
60+
61+ - name : Archive screenshots
62+ uses : actions/upload-artifact@v3
63+ with :
64+ name : themes-screenshots
65+ path : screenshot-*.png
0 commit comments