Add disk temperature sensor and DISK/TEMPERATURE theme fields #622
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: System monitor - themes screenshot (on PR) | |
| on: | |
| pull_request: | |
| paths: | |
| - 'library/**' | |
| - 'res/themes/**' | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.event_name }}-${{ github.head_ref || github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| system-monitor-theme-screenshot: | |
| name: Generate screenshot for all themes | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v7 | |
| - name: Set up Python 3.x | |
| uses: actions/setup-python@v7 | |
| with: | |
| python-version: "3.14" | |
| - name: Install dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| python -m pip install -r requirements.txt | |
| - name: Configure system monitor for screenshot | |
| run: | | |
| # Use random data | |
| sed -i "/HW_SENSORS:/c\ HW_SENSORS: STUB" config.yaml | |
| - name: Run system monitor on all themes | |
| run: | | |
| for dir in res/themes/*/ | |
| do | |
| if test -f "$dir/theme.yaml"; then | |
| # Keep only folder name | |
| theme=`basename "${dir%*/}"` | |
| # Setup selected theme in config.yaml | |
| echo "Using theme $theme" | |
| sed -i '/THEME:/c\ THEME: "'"$theme"'"' config.yaml | |
| # For tests there is no real HW: use simulated LCD mode | |
| sed -i "/REVISION:/c\ REVISION: SIMU" config.yaml | |
| # Run system-monitor in theme screenshot mode | |
| python3 main.py -t 10 > output.log 2>&1 | |
| # Rename screen capture | |
| cp screencap.png "screenshot-$theme.png" | |
| # Compare with original theme preview to detect changes, generate a diff | |
| if [ -f "$dir/preview.png" ]; then | |
| python3 tools/compare-images.py "screenshot-$theme.png" "$dir/preview.png" "diff-$theme.png" | |
| if [ -f "diff-$theme.png" ]; then | |
| echo "::warning::$theme theme rendering has changed, check if it is intentional or a side-effect. A diff is included in the job artifacts." | |
| fi | |
| fi | |
| fi | |
| done | |
| - name: Archive screenshots | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: themes-screenshots | |
| path: | | |
| screenshot-*.png | |
| diff-*.png |