Create django.yml

且听风吟 6 years ago committed by GitHub
parent 3e7063e910
commit a945bc216b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -0,0 +1,54 @@
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/mysql-action@v1.3
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 test
Loading…
Cancel
Save