Add ValidateFuzzyUnique validator to CategoryModelSerializer cat field #34
This file contains 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
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions | |
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python | |
name: Django Tests | |
on: | |
push: | |
branches: [ "*" ] | |
pull_request: | |
branches: [ "dev" ] | |
types: | |
- opened # run workflow only when .py files are modified | |
paths: | |
- "**.py" | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
python-version: ["3.11"] | |
environment: | |
name: dev-test | |
url: https://github.com/Termuellinator/muchan | |
env: | |
DB_HOST: ${{ vars.DB_HOST }} | |
DB_NAME: ${{ vars.DB_NAME }} | |
DB_USER: ${{ secrets.DB_USER }} | |
DB_PASSWORD: ${{ secrets.DB_PASSWORD }} | |
DB_PORT: ${{ vars.DB_PORT }} | |
DB_SECRET: ${{ secrets.DB_SECRET }} | |
services: | |
postgres_main: | |
image: postgres:15 | |
env: | |
POSTGRES_USER: ${{ secrets.DB_USER }} | |
POSTGRES_PASSWORD: ${{ secrets.DB_PASSWORD }} | |
POSTGRES_DB: ${{ vars.DB_NAME }} | |
ports: | |
- 5432:5432 | |
options: >- | |
--health-cmd pg_isready | |
--health-interval 10s | |
--health-retries 4 | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v3 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
python -m pip install flake8 | |
make dev-install | |
- name: Lint with flake8 | |
run: | | |
# stop the build if there are Python syntax errors or undefined names | |
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics | |
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide | |
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics | |
- name: Test with django test | |
run: | | |
make dev-test v=2 | |