Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update workflows #593

Merged
merged 3 commits into from
May 9, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 4 additions & 13 deletions .github/workflows/django.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,37 +5,28 @@ on:

jobs:
build:
runs-on: ubuntu-20.04
runs-on: ubuntu-latest
steps:
- name: Start MySQL
run: |
sudo systemctl start mysql.service
mysql_tzinfo_to_sql /usr/share/zoneinfo | mysql -uroot -proot mysql
mysql -uroot -proot -e "CREATE USER 'scott'@'%' IDENTIFIED BY 'tiger'; GRANT ALL ON *.* TO scott;"

- uses: actions/cache@v2
with:
path: ~/.cache/pip
key: ${{ runner.os }}-django-pip-1
restore-keys: |
${{ runner.os }}-pip-
- uses: actions/checkout@v3

- name: Set up Python
uses: actions/setup-python@v2
uses: actions/setup-python@v4
with:
# https://www.mail-archive.com/django-updates@googlegroups.com/msg209056.html
python-version: "3.8"

- uses: actions/checkout@v2
with:
fetch-depth: 2

- name: Install mysqlclient
env:
PIP_NO_PYTHON_VERSION_WARNING: 1
PIP_DISABLE_PIP_VERSION_CHECK: 1
run: |
pip install -U pytest pytest-cov tblib
pip install -r requirements.txt
pip install .
# pip install mysqlclient # Use stable version

Expand Down
21 changes: 6 additions & 15 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,29 +6,20 @@ on:

jobs:
build:
runs-on: ubuntu-20.04
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11"]
python-version: ["3.8", "3.9", "3.10", "3.11"]
steps:
- name: Start MySQL
run: |
sudo systemctl start mysql.service
mysql -uroot -proot -e "CREATE DATABASE mysqldb_test"

- uses: actions/cache@v2
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-1
restore-keys: |
${{ runner.os }}-pip-

- uses: actions/checkout@v2
with:
fetch-depth: 2
- uses: actions/checkout@v3

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}

Expand All @@ -37,7 +28,7 @@ jobs:
PIP_NO_PYTHON_VERSION_WARNING: 1
PIP_DISABLE_PIP_VERSION_CHECK: 1
run: |
pip install -U coverage pytest pytest-cov
pip install -r requirements.txt
python setup.py develop

- name: Run tests
Expand All @@ -46,4 +37,4 @@ jobs:
run: |
pytest --cov=MySQLdb tests

- uses: codecov/codecov-action@v1
- uses: codecov/codecov-action@v3
1 change: 0 additions & 1 deletion metadata.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ classifiers:
Programming Language :: C
Programming Language :: Python
Programming Language :: Python :: 3
Programming Language :: Python :: 3.7
Programming Language :: Python :: 3.8
Programming Language :: Python :: 3.9
Programming Language :: Python :: 3.10
Expand Down
5 changes: 5 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# This file is for GitHub Action
coverage
pytest
pytest-cov
tblib