Rewrite compose filters as cross-filter computation, split views and tests #18
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: Tests | |
| on: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| branches: [main] | |
| jobs: | |
| unit-tests: | |
| name: Unit Tests | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| python-version: ["3.10", "3.11", "3.12"] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| - name: Install dependencies | |
| run: | | |
| pip install --upgrade pip | |
| pip install "Django>=4.2,<5" coverage | |
| - name: Run unit tests | |
| run: | | |
| coverage run -m unittest \ | |
| coldfront_notifications.tests.test_resolvers \ | |
| coldfront_notifications.tests.test_validators \ | |
| coldfront_notifications.tests.test_tasks_unit \ | |
| coldfront_notifications.tests.test_filters \ | |
| coldfront_notifications.tests.test_conf \ | |
| -v | |
| coverage report --show-missing --fail-under=80 \ | |
| --include="coldfront_notifications/template_variable_value_resolver.py,coldfront_notifications/notification_validator.py,coldfront_notifications/campaign_sender.py,coldfront_notifications/conf.py,coldfront_notifications/__init__.py" | |
| env: | |
| PYTHONPATH: . | |
| - name: Upload coverage | |
| if: matrix.python-version == '3.10' | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: unit-coverage | |
| path: .coverage | |
| lint: | |
| name: Lint | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.10" | |
| - name: Install dependencies | |
| run: | | |
| pip install --upgrade pip | |
| pip install flake8 | |
| - name: Flake8 | |
| run: | | |
| flake8 coldfront_notifications/ \ | |
| --max-line-length=120 \ | |
| --exclude=migrations,__pycache__,tests \ | |
| --ignore=E501,W503,E402,E241,E221,E231,W292 | |
| build: | |
| name: Build Package | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.10" | |
| - name: Install build tools | |
| run: pip install build twine | |
| - name: Build | |
| run: python -m build | |
| - name: Check package | |
| run: twine check dist/* | |
| - name: Verify wheel installs | |
| run: | | |
| pip install dist/*.whl | |
| python -c " | |
| import coldfront_notifications | |
| print(f'Installed: coldfront_notifications {coldfront_notifications.__version__}') | |
| " |