forked from liangliangyy/DjangoBlog
-
Notifications
You must be signed in to change notification settings - Fork 0
56 lines (52 loc) · 1.9 KB
/
django.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
name: Django CI
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
build:
runs-on: ubuntu-latest
strategy:
max-parallel: 4
matrix:
python-version: [3.6, 3.7, 3.8]
steps:
- name: Start MySQL
uses: samin/[email protected]
with:
# The port of host
host port: 3306 # optional, default is 3306
# The port of container
container port: 3306 # optional, default is 3306
# --character-set-server - The character set of MySQL server
character set server: utf8mb4 # optional, default is utf8mb4
# --collation-server - The character collation of MySQL server
collation server: utf8mb4_general_ci # optional, default is utf8mb4_general_ci
# Version of MySQL to use
mysql version: latest # optional, default is latest
# MYSQL_ROOT_PASSWORD - root superuser password
mysql root password: root # optional, default is
# MYSQL_DATABASE - name for the default database that is created
mysql database: djangoblog # optional, default is
# MYSQL_USER - create the specified user with superuser power for created database
mysql user: root # optional, default is
# MYSQL_PASSWORD - specified superuser password which user is power for created database
mysql password: root # optional, default is
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v1
with:
python-version: ${{ matrix.python-version }}
- name: Install Dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: Run Tests
env:
DJANGO_MYSQL_PASSWORD: root
DJANGO_MYSQL_HOST: 127.0.0.1
run: |
python manage.py makemigrations
python manage.py migrate
python manage.py test