[pre-commit.ci] pre-commit autoupdate (#410) #847
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
name: Django CI | |
on: | |
push: | |
branches: [ main ] | |
tags: | |
- '*' | |
pull_request: | |
branches: [ main ] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
env: | |
DATABASE_URL: postgres://postgres:postgres@127.0.0.1:5432/github_actions | |
DJANGO_CONFIGURATION: Test | |
strategy: | |
max-parallel: 4 | |
matrix: | |
python-version: [3.11] | |
services: | |
postgres: | |
image: postgres:13-alpine | |
env: | |
POSTGRES_PASSWORD: postgres | |
POSTGRES_USER: postgres | |
POSTGRES_DB: github_actions | |
ports: | |
- 5432:5432 | |
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5 | |
steps: | |
- name: Checkout code # checking our the code at current commit that triggers the workflow | |
uses: actions/checkout@v3 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v4.7.0 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Cache dependency # caching dependency will make our build faster. | |
uses: actions/cache@v3 # for more info checkout pip section documentation at https://github.com/actions/cache | |
with: | |
path: ~/.cache/pip | |
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements-dev.txt') }} | |
restore-keys: | | |
${{ runner.os }}-pip- | |
- name: Check Code Style | |
uses: pre-commit/action@v3.0.0 | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip wheel pip-tools | |
python -m pip install -r requirements-dev.txt | |
coverage run -m pytest -n auto | |
- name: Run Django Check | |
run: python manage.py check |