Upgrade project #16
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: Checks | |
on: | |
push: | |
branches: | |
- master | |
jobs: | |
checks: | |
name: Run Django checks | |
runs-on: ubuntu-latest | |
services: | |
postgres: | |
image: postgres:latest | |
env: | |
POSTGRES_USER: semkov | |
POSTGRES_PASSWORD: semkov | |
POSTGRES_DB: semkov | |
ports: | |
- 5432:5432 | |
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5 | |
steps: | |
- name: Check out the repository | |
uses: actions/checkout@v3 | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: "3.12" | |
- name: Cache pip | |
uses: actions/cache@v3 | |
with: | |
path: ~/.cache/pip | |
key: ${{ runner.os }}-pip-${{ hashFiles('requirements.txt') }} | |
restore-keys: | | |
${{ runner.os }}-pip- | |
${{ runner.os }}- | |
- name: Install dependencies | |
shell: bash | |
run: | | |
python -m pip install --upgrade pip | |
pip install -r requirements.txt | |
- name: Check for missing migrations | |
run: | | |
python manage.py makemigrations --dry-run --check --verbosity=3 --settings=semkov.settings.test | |
- name: Run Django system checks | |
run: | | |
python manage.py check --fail-level WARNING --settings=semkov.settings.test | |
- name: Run pre-commit hook | |
uses: pre-commit/action@v3.0.0 | |
- name: Run Pytest suite | |
run: | | |
pytest --create-db --disable-warnings --ds=semkov.settings.test semkov/ | |
- name: Build docker image | |
run: | | |
docker build -t mantiby/semkov:latest . |