Skip to content

Commit f4b984e

Browse files
committed
修改自动测试action,增加无es场景测试。
1 parent 3b5c50c commit f4b984e

File tree

3 files changed

+40
-7
lines changed

3 files changed

+40
-7
lines changed

.github/workflows/django.yml

Lines changed: 39 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,46 @@ on:
2121
- '**/*.yml'
2222

2323
jobs:
24-
build:
24+
build-normal:
25+
runs-on: ubuntu-latest
26+
strategy:
27+
max-parallel: 4
28+
matrix:
29+
python-version: [ 3.6, 3.7, 3.8, 3.9 ]
30+
31+
steps:
32+
- name: Start MySQL
33+
uses: samin/[email protected]
34+
with:
35+
host port: 3306
36+
container port: 3306
37+
character set server: utf8mb4
38+
collation server: utf8mb4_general_ci
39+
mysql version: latest
40+
mysql root password: root
41+
mysql database: djangoblog
42+
mysql user: root
43+
mysql password: root
44+
45+
- uses: actions/checkout@v2
46+
- name: Set up Python ${{ matrix.python-version }}
47+
uses: actions/setup-python@v1
48+
with:
49+
python-version: ${{ matrix.python-version }}
50+
- name: Install Dependencies
51+
run: |
52+
python -m pip install --upgrade pip
53+
pip install -r requirements.txt
54+
- name: Run Tests
55+
env:
56+
DJANGO_MYSQL_PASSWORD: root
57+
DJANGO_MYSQL_HOST: 127.0.0.1
58+
run: |
59+
python manage.py makemigrations
60+
python manage.py migrate
61+
python manage.py test
2562
63+
build-with-es:
2664
runs-on: ubuntu-latest
2765
strategy:
2866
max-parallel: 4

.github/workflows/docker.yml

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,4 @@ jobs:
2828
with:
2929
context: .
3030
push: true
31-
platforms: |
32-
linux/amd64
33-
linux/arm64
34-
linux/arm/v7
35-
linux/arm/v6
36-
linux/386
3731
tags: ${{ secrets.DOCKERHUB_USERNAME }}/djangoblog:latest

blog/documents.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,7 @@ def delete_index():
109109

110110
@staticmethod
111111
def create(url, time_taken, log_datetime, useragent, ip):
112+
ElaspedTimeDocumentManager.build_index()
112113
ua = UserAgent()
113114
ua.browser = UserAgentBrowser()
114115
ua.browser.Family = useragent.browser.family

0 commit comments

Comments
 (0)