forked from ZU-Hospital/zu-hospital-backend
-
Notifications
You must be signed in to change notification settings - Fork 0
64 lines (49 loc) · 1.64 KB
/
check.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
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