Skip to content
This repository was archived by the owner on Aug 26, 2024. It is now read-only.

Commit 77a8cf5

Browse files
committed
refactor yaml
1 parent e6ab6cf commit 77a8cf5

File tree

2 files changed

+10
-19
lines changed

2 files changed

+10
-19
lines changed

.github/workflows/ci.yml

Lines changed: 9 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@ jobs:
1818
mysql:
1919
image: mysql:5.7
2020
env:
21-
DB_DATABASE: python_blogs
22-
DB_USER: root
23-
DB_PASSWORD:
21+
MYSQL_ALLOW_EMPTY_PASSWORD: true
22+
MYSQL_ROOT_PASSWORD: root
23+
MYSQL_DATABASE: python_blogs
2424
ports: ['3306:3306']
2525

2626
steps:
@@ -32,14 +32,17 @@ jobs:
3232
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
3333
restore-keys: |
3434
${{ runner.os }}-pip-
35+
3536
- name: Set up Python ${{ matrix.python-version }}
3637
uses: actions/setup-python@v3
3738
with:
3839
python-version: ${{ matrix.python-version }}
40+
3941
- name: Install Dependencies
4042
run: |
4143
python -m pip install --upgrade pip
4244
pip install -r requirements.txt
45+
4346
- name: Copy settings
4447
run: |
4548
cp settings_local.py.template settings_local.py
@@ -48,24 +51,12 @@ jobs:
4851
run: |
4952
sudo service mysql start
5053
sudo mysql -uroot -proot -e 'CREATE DATABASE python_blogs;'
54+
5155
- name: Run Migrations
5256
run: |
5357
python manage.py migrate
5458
python manage.py loaddata data.json
55-
env:
56-
DBENGINE: django.db.backends.mysql
57-
DBNAME: python_blogs
58-
DBUSER: root
59-
DBPASSWORD:
60-
DBHOST: 127.0.0.1
61-
DBPORT: $
59+
6260
- name: Run Tests
6361
run: |
64-
python manage.py test
65-
env:
66-
DBENGINE: django.db.backends.mysql
67-
DBNAME: python_blogs
68-
DBUSER: root
69-
DBPASSWORD:
70-
DBHOST: 127.0.0.1
71-
DBPORT: $
62+
python manage.py test

settings_local.py.template

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ DATABASES = {
2020
"ENGINE": "django.db.backends.mysql", # Add 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'.
2121
"HOST": "", # Set to empty string for localhost. Not used with sqlite3.
2222
"NAME": "python_blogs", # Or path to database file if using sqlite3.
23-
"PASSWORD": "root", # Not used with sqlite3.
23+
"PASSWORD": "", # Not used with sqlite3.
2424
"PORT": "", # Set to empty string for default. Not used with sqlite3.
2525
"USER": "root", # Not used with sqlite3.
2626
}

0 commit comments

Comments
 (0)