forked from eee555/saolei_website
-
Notifications
You must be signed in to change notification settings - Fork 2
62 lines (51 loc) · 1.41 KB
/
backend.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
name: Back-end Test
on:
push:
branches:
- main # Adjust the branch name as needed
pull_request:
paths:
- 'back_end/saolei/**'
jobs:
check_flag:
runs-on: ubuntu-latest
defaults:
run:
working-directory: back_end/saolei
services:
mysql:
image: mysql:latest
env:
MYSQL_DATABASE: saolei
MYSQL_ROOT_PASSWORD: 123456
options: --health-cmd="mysqladmin ping --silent" --health-interval=10s --health-timeout=5s --health-retries=3
ports:
- 3306:3306
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Install Python
uses: actions/setup-python@v2
with:
python-version: '3.10' # Choose the Python version you want to use
- name: Install Dependencies
run: |
pip install -r requirements.txt
pip install cryptography
- name: Create Logs Directory
run: mkdir -p logs
- name: Run Tests
env:
DJANGO_DB_NAME: saolei
DJANGO_DB_USER: root
DJANGO_DB_PASSWORD: 123456
DJANGO_DB_HOST: 127.0.0.1
run: |
python manage.py makemigrations
python manage.py migrate
- name: Flags
run: python -m unittest tests.py -v
- name: Video Manager
run: python manage.py test videomanager
- name: Account Link
run: python manage.py test accountlink