Skip to content

add cache

add cache #108

Workflow file for this run

name: Django CI
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
test:
name: Run tests and check code quality
runs-on: ubuntu-latest
# Remove the strategy matrix to run the job sequentially
# strategy:
# matrix:
# python-version: [ 3.11 ]
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Python 3.11
uses: actions/setup-python@v4
with:
python-version: 3.11
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: Set up environment variables
env:
DATABASE_URL: ${{ secrets.DATABASE_URL }}
run: |
echo "DATABASE_URL=$DATABASE_URL" >> $GITHUB_ENV
# - name: Prepare database
# run: |
# python manage.py migrate --no-input
# python manage.py collectstatic --no-input
- name: Run tests
run: |
cd project
python manage.py makemigrations
python manage.py migrate
python manage.py test --no-input
# run: python project/manage.py test project --no-input