Skip to content

Update README.md

Update README.md #7

Workflow file for this run

# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
name: build
on: push
jobs:
CI:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.10']
services:
# Label used to access the service container
db:
# Docker Hub image
image: postgres:latest
# Provide the password for postgres
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: postgres
# Set health checks to wait until postgres has started
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
ports:
# Maps tcp port 5432 on service container to the host
- 5432:5432
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Cache pip
uses: actions/cache@v2
with:
# This path is specific to Ubuntu
path: ~/.cache/pip
# Look to see if there is a cache hit for the corresponding requirements file
key: ${{ runner.os }}-pip-${{ hashFiles('requirements/local.txt') }}
restore-keys: |
${{ runner.os }}-pip-
${{ runner.os }}-
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install flake8
pip install -r requirements/local.txt
- 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 coverage with pytest
env:
DJANGO_SETTINGS_MODULE: conf.settings.test
DJANGO_SECRET_KEY: testsecret
DJANGO_DEBUG: False
DOMAIN_ALIASES: localhost,127.0.0.1
SECURE_SSL_REDIRECT: False
STAGE: test
DATABASE_URL: postgres://postgres:postgres@localhost:5432/postgres
DEFAULT_STORAGE_DSN: file:///tmp/media/?url=%2Fmedia%2F
CACHE_URL: locmem://unique-snowflake
run: |
python manage.py makemigrations --noinput
pytest -n 4 --cov=apps