Bump version #26
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: django-askell CI | |
| on: | |
| push: | |
| branches: | |
| - '**' | |
| pull_request_target: | |
| types: [opened, synchronize, reopened, ready_for_review] | |
| jobs: | |
| test: | |
| strategy: | |
| matrix: | |
| os: [ubuntu-22.04] | |
| python-version: [3.12] | |
| runs-on: ${{ matrix.os }} | |
| services: | |
| postgres: | |
| image: postgres | |
| env: | |
| POSTGRES_HOST: localhost | |
| POSTGRES_USER: postgres | |
| POSTGRES_PASSWORD: postgres | |
| POSTGRES_DB: askell | |
| ports: | |
| - 5432:5432 | |
| options: >- | |
| --health-cmd pg_isready | |
| --health-interval 10s | |
| --health-timeout 5s | |
| --health-retries 5 | |
| if: | | |
| (github.event_name == 'pull_request_target' && github.actor == 'dependabot[bot]') || | |
| (github.event_name != 'pull_request_target' && github.actor != 'dependabot[bot]') | |
| steps: | |
| - name: Check out repository code | |
| if: ${{ github.event_name != 'pull_request_target' }} | |
| uses: actions/checkout@v2 | |
| - name: Check out Dependabot | |
| if: ${{ github.event_name == 'pull_request_target' }} | |
| uses: actions/checkout@v2 | |
| with: | |
| ref: ${{ github.event.pull_request.head.sha }} | |
| - name: Set up Python ${{ matrix.python-version }} | |
| uses: actions/setup-python@v2 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| - name: Configure sysctl limits | |
| run: | | |
| sudo swapoff -a | |
| sudo sysctl -w vm.swappiness=1 | |
| sudo sysctl -w fs.file-max=262144 | |
| sudo sysctl -w vm.max_map_count=262144 | |
| - name: Install Python dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install -r test_project/requirements.txt | |
| pip install -e . | |
| - name: Run python linter | |
| run: ruff check . | |
| - name: Set up DB config | |
| run: | | |
| echo '''DATABASES = { | |
| "default": { | |
| "ENGINE": "django.db.backends.postgresql_psycopg2", | |
| "NAME": "askell", | |
| "HOST": "localhost", | |
| "USER": "postgres", | |
| "PASSWORD": "postgres", | |
| "CONN_MAX_AGE": 600, | |
| } | |
| }''' > test_project/settings.py | |
| - name: Run migrations | |
| run: cd test_project && python manage.py migrate | |
| # - name: Collect static files | |
| # run: cd test_project && python manage.py collectstatic --noinput | |
| - name: Run tests | |
| run: | | |
| cd test_project && python manage.py test | |