Skip to content

Use uv for installing + compiling deps locally #110

Use uv for installing + compiling deps locally

Use uv for installing + compiling deps locally #110

Workflow file for this run

name: Django CI
on: [ push, pull_request ]
jobs:
#
# Security
#
bandit:
name: Check for security issues with Bandit
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v3
with:
python-version: '3.11'
- name: Install dependencies
run: |
pip install -r requirements/ci.txt
- name: Run Bandit
run: |
bandit -r src/articles/ -x tests
bandit -r src/scraper/ -x tests
#
# Tests
#
tests:
name: Run tests
runs-on: ubuntu-latest
strategy:
max-parallel: 4
matrix:
python-version: ['3.11']
services:
db:
image: postgres
env:
POSTGRES_DB: postgres
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
ports:
- 5432:5432
options:
--health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
--name postgres
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements/ci.txt
- name: Run tests
env:
SECRET_KEY: dummy
DJANGO_ENV: BASE
SECURE_SSL_REDIRECT: False
run: pytest
#
# Migrations
#
migrations:
name: Check for model changes not present in the migrations
runs-on: ubuntu-latest
services:
db:
image: postgres
env:
POSTGRES_DB: postgres
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
ports:
- 5432:5432
options:
--health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
--name postgres
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: '3.11'
- name: Install dependencies
run: |
sudo apt-get update
pip install -r requirements/ci.txt
- name: Run manage.py makemigrations --check --dry-run
run: |
python manage.py makemigrations --check --dry-run
env:
SECRET_KEY: dummy
DJANGO_ENV: BASE