Skip to content

steps 1,2 and 3

steps 1,2 and 3 #79

Workflow file for this run

name: Run backend code checks
on:
pull_request:
jobs:
test-backend:
runs-on: ubuntu-latest
env:
ENVIRONMENT: "development"
POSTGRES_DB_HOST: "localhost"
POSTGRES_DB_PORT: 5432
POSTGRES_DB_NAME: "large_application_template"
POSTGRES_DB_USER: "large_application_template_user"
POSTGRES_DB_PASSWORD: "large_application_template_password"
BROKER_URL: "memory://"
services:
db:
image: postgres:15
ports:
- 5432:5432
env:
POSTGRES_DB: "large_application_template"
POSTGRES_USER: "large_application_template_user"
POSTGRES_PASSWORD: "large_application_template_password"
steps:
- uses: actions/checkout@v3
- name: Cache python dependencies
uses: actions/cache@v3
env:
cache-name: cache-python
with:
path: ~/.cache/pip
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/requirements/*.txt') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: "3.11"
- name: Install python dependencies
run: pip install -r backend/requirements/development.txt
- name: Prepare database
run: alembic upgrade head
working-directory: backend/migrations/
- name: Run black
run: make black_check
working-directory: backend
- name: Lint code
run: make ruff_check
working-directory: backend
- name: Run mypy
run: make mypy_check
working-directory: backend
- name: Run bandit
run: make bandit_check
working-directory: backend
- name: Run tests
run: make tests
working-directory: backend