Fix Navbar, add PR checks, UI/UX improvements #6
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 | |
| env: | |
| PYTHONPATH: . | |
| - name: Run unit tests | |
| run: | | |
| coverage run -m unittest coldfront_notifications.tests.test_unit -v | |
| coverage report --show-missing --fail-under=80 \ | |
| --include="coldfront_notifications/resolvers.py,coldfront_notifications/validators.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 contents | |
| run: | | |
| pip install dist/*.whl | |
| python -c " | |
| import django | |
| from django.conf import settings | |
| settings.configure( | |
| INSTALLED_APPS=[ | |
| 'django.contrib.contenttypes', | |
| 'django.contrib.auth', | |
| 'django.contrib.admin', | |
| 'django.contrib.sessions', | |
| 'django.contrib.messages', | |
| 'coldfront_notifications', | |
| ], | |
| DATABASES={'default': {'ENGINE': 'django.db.backends.sqlite3', 'NAME': ':memory:'}}, | |
| DEFAULT_AUTO_FIELD='django.db.models.BigAutoField', | |
| AUTH_USER_MODEL='auth.User', | |
| ROOT_URLCONF='coldfront_notifications.urls', | |
| ) | |
| django.setup() | |
| from coldfront_notifications import urls, models, views, resolvers, validators, tasks, conf | |
| print('All modules importable') | |
| " |