fix: stop OON policies churning as ghost deletions on UniFi 10.x (#15… #207
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: Test Suite | |
| on: | |
| push: | |
| branches: [ main, dev ] | |
| pull_request: | |
| branches: [ main, dev ] | |
| permissions: | |
| contents: read | |
| checks: write | |
| pull-requests: write | |
| statuses: write | |
| jobs: | |
| test: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.13.0' | |
| - name: Install dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install -r requirements.txt | |
| - name: Lint with Ruff | |
| run: ruff check custom_components/ | |
| - name: Run tests with coverage | |
| run: | | |
| pytest --cov=custom_components/unifi_network_rules --cov-report=term-missing --cov-report=xml --cov-fail-under=0 | |
| - name: Coverage Report | |
| if: always() | |
| run: | | |
| echo "## Coverage Summary" >> $GITHUB_STEP_SUMMARY | |
| echo "Coverage target: 60% (advisory, non-blocking)" >> $GITHUB_STEP_SUMMARY | |
| if [ -f coverage.xml ]; then | |
| coverage report --format=markdown >> $GITHUB_STEP_SUMMARY 2>/dev/null || echo "See test output for coverage details" >> $GITHUB_STEP_SUMMARY | |
| fi | |
| - name: Report Status | |
| if: always() | |
| uses: actions/github-script@v7 | |
| with: | |
| script: | | |
| const conclusion = '${{ job.status }}'.toLowerCase(); | |
| await github.rest.repos.createCommitStatus({ | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| sha: context.sha, | |
| state: conclusion === 'success' ? 'success' : 'failure', | |
| description: conclusion === 'success' ? 'All tests passed!' : 'Some tests failed.', | |
| context: 'Test Suite' | |
| }); |