fix: correct legacy Discord config detection in validate_config #45
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: Validate | |
| on: | |
| push: | |
| branches: [ main ] | |
| pull_request: | |
| branches: [ main ] | |
| jobs: | |
| validate: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| python-version: ['3.9', '3.10', '3.11', '3.12', '3.13', '3.14'] | |
| 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 | |
| pip install pyyaml apprise | |
| pip install pytest pytest-cov pytest-mock | |
| - name: Check syntax | |
| run: python -m py_compile src/eneru/monitor.py | |
| - name: Run tests | |
| run: | | |
| pytest --cov=src/eneru --cov-report=xml --cov-report=term -v | |
| - name: Upload coverage to Codecov | |
| if: matrix.python-version == '3.11' | |
| uses: codecov/codecov-action@v4 | |
| with: | |
| files: ./coverage.xml | |
| fail_ci_if_error: false | |
| verbose: true | |
| env: | |
| CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} | |
| - name: Validate default config | |
| run: python src/eneru/monitor.py --validate-config --config config.yaml | |
| - name: Validate example configs | |
| run: | | |
| for config in examples/*.yaml; do | |
| echo "Validating $config..." | |
| python src/eneru/monitor.py --validate-config --config "$config" | |
| done |