HACS Validation #128
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: HACS Validation | |
| on: | |
| push: | |
| pull_request: | |
| schedule: | |
| - cron: "0 0 * * *" | |
| workflow_dispatch: | |
| jobs: | |
| hacs: | |
| name: HACS Validation | |
| runs-on: "ubuntu-latest" | |
| steps: | |
| - name: Check out repository | |
| uses: "actions/checkout@v6" | |
| - name: HACS validation | |
| uses: "hacs/action@main" | |
| with: | |
| category: "integration" | |
| ignore: brands | |
| quality: | |
| name: Code Quality | |
| runs-on: "ubuntu-latest" | |
| steps: | |
| - name: Check out repository | |
| uses: "actions/checkout@v6" | |
| - name: Set up Python | |
| uses: "actions/setup-python@v6" | |
| with: | |
| python-version: "3.11" | |
| - name: Install dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install homeassistant aiohttp pysnmp | |
| - name: Validate Python syntax | |
| run: | | |
| python -m py_compile custom_components/snmp_printer/*.py | |
| - name: Check manifest.json | |
| run: | | |
| python3 -c " | |
| import json | |
| import os | |
| manifest_path = 'custom_components/snmp_printer/manifest.json' | |
| if not os.path.exists(manifest_path): | |
| print('manifest.json not found') | |
| exit(1) | |
| with open(manifest_path, 'r') as f: | |
| manifest = json.load(f) | |
| required_keys = ['domain', 'name', 'config_flow', 'documentation', 'issue_tracker', 'codeowners', 'version'] | |
| for key in required_keys: | |
| if key not in manifest: | |
| print(f'Missing required key in manifest: {key}') | |
| exit(1) | |
| print('✓ manifest.json is valid') | |
| " |