Skip to content

Update README.md

Update README.md #226

name: "Lint & Test"
on: push
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
Lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version-file: '.python-version'
- name: Setup virtualenv
run: |
python3 -m venv ./.venv
source .venv/bin/activate
- name: Install dependencies
run: pip install -Ur ./requirements.txt
- name: Black
run: black --check .
- name: isort
run: isort --check .
- name: flake8
run: flake8 --exclude .venv
Tests:
runs-on: ubuntu-latest
services:
postgres:
image: postgres:latest
env:
POSTGRES_DB: stupid_django_tricks
POSTGRES_PASSWORD: postgres
POSTGRES_USER: postgres
ports:
- 5432:5432
# Set health checks to wait until postgres has started
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version-file: '.python-version'
- name: Setup virtualenv
run: |
python3 -m venv ./.venv
source .venv/bin/activate
- name: Install dependencies
run: pip install -Ur ./requirements.txt
- name: Run tests
run: pytest
env:
DATABASE_URL: postgres://postgres:postgres@localhost/stupid_django_tricks