-
Notifications
You must be signed in to change notification settings - Fork 9
59 lines (54 loc) · 2.01 KB
/
e2e.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
name: e2e
on:
push:
branches:
- main
- develop
workflow_dispatch: {}
pull_request:
branches:
- main
- develop
jobs:
e2e:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
- name: Install ffmpeg
uses: awalsh128/cache-apt-pkgs-action@latest
with:
packages: ffmpeg
- name: Install dependencies
run: |
cd hinghwa-dict-backend
if [ -f requirements.txt ]; then pip3 install -r requirements.txt; fi
- name: Start django service
run: |
cd hinghwa-dict-backend
python3 manage.py makemigrations --merge --no-input
python3 manage.py migrate
DJANGO_SUPERUSER_PASSWORD=testtest123 python manage.py createsuperuser --username admin --email [email protected] --no-input
DJANGO_SUPERUSER_PASSWORD=testtest222 python manage.py createsuperuser --username admin2 --email [email protected] --no-input
echo -e "from django.contrib.auth.models import User\nuser=User.objects.create_user('user_test','user_test@user_test.com','123456')\nuser.set_password('123456')\nuser.save()\nexit()" | python manage.py shell
echo -e "from django.contrib.auth.models import User\nuser=User.objects.create_user('user_test_old_password','user_test_old_password@user_test_old_password.com','12')\nuser.set_password('12')\nuser.save()\nexit()"| python manage.py shell
python3 manage.py runserver &
- uses: actions/setup-node@v3
with:
node-version: "16.x"
- name: Install apifox cli
run: |
npm install -g apifox-cli
- name: Run tests
run: |
curl 127.0.0.1:8000/users/1
curl 127.0.0.1:8000/users/2
curl 127.0.0.1:8000/users/3
curl 127.0.0.1:8000/users/4
cd tests
for test in `ls .`
do
apifox run ${test} -r html,cli
done
- name: Kill django service
run: |
pkill -9 -f manage.py