Skip to content

media

media #114

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 }}
DROPBOX_OAUTH2_REFRESH_TOKEN: ${{ secrets.DROPBOX_OAUTH2_REFRESH_TOKEN }}
DROPBOX_APP_KEY: ${{ secrets.DROPBOX_APP_KEY }}
DROPBOX_APP_SECRET : ${{ secrets.DROPBOX_APP_SECRET }}
run: |
echo "DATABASE_URL=$DATABASE_URL" >> $GITHUB_ENV
echo "DROPBOX_OAUTH2_REFRESH_TOKEN=$DROPBOX_OAUTH2_REFRESH_TOKEN" >> $GITHUB_ENV
echo "DROPBOX_APP_KEY=$DROPBOX_APP_KEY" >> $GITHUB_ENV
echo "DROPBOX_APP_SECRET=$DROPBOX_APP_SECRET" >> $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