Skip to content

Django security update #89

Django security update

Django security update #89

Workflow file for this run

name: Test App Built with Starter Kit
on:
pull_request:
push:
branches:
- main
jobs:
test:
runs-on: ubuntu-latest
name: Build project & check test coverage
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: '3.11'
- uses: actions/[email protected]
with:
node-version: v18.12.1
- name: Install dependencies, run tests
run: |
mkdir test_project
cd test_project
python3 -m venv --prompt . .venv
.venv/bin/pip install -U pip setuptools wheel
.venv/bin/python -m pip install pip-tools Django
.venv/bin/django-admin startproject --exclude=.git,__pycache__,.env --template=https://github.com/piepworks/django-starter/archive/${BRANCH_NAME}.zip test_project .
.venv/bin/pip-compile --resolver=backtracking requirements/requirements.in
.venv/bin/python -m pip install -r requirements/requirements.txt
.venv/bin/python manage.py makemigrations
.venv/bin/python manage.py migrate --noinput
.venv/bin/python manage.py collectstatic --noinput
npm install
npm run build
.venv/bin/coverage run .venv/bin/pytest
.venv/bin/coverage xml
env:
BRANCH_NAME: ${{ github.head_ref || github.ref_name }}
DEBUG: 0
ALLOWED_HOSTS: '*'
CSRF_TRUSTED_ORIGINS: ${{ vars.CSRF_TRUSTED_ORIGINS }}
ADMIN_URL: ${{ secrets.ADMIN_URL }}
ADMIN_EMAIL_FROM: ${{ secrets.ADMIN_EMAIL_FROM }}
ADMIN_EMAIL_TO: ${{ secrets.ADMIN_EMAIL_TO }}
DEFAULT_FROM_EMAIL: ${{ secrets.DEFAULT_FROM_EMAIL }}
SERVER_EMAIL: ${{ secrets.SERVER_EMAIL }}
EMAIL_BACKEND: ${{ vars.EMAIL_BACKEND }}
EMAIL_HOST: ${{ secrets.EMAIL_HOST }}
EMAIL_PORT: ${{ secrets.EMAIL_PORT }}
EMAIL_HOST_USER: ${{ secrets.EMAIL_HOST_USER }}
EMAIL_HOST_PASSWORD: ${{ secrets.EMAIL_HOST_PASSWORD }}
EMAIL_USE_TLS: '1'
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v3
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
with:
files: coverage.xml