Update workflows (#593)

* Drop Python 3.7
* Use latest actions

Fix #591
This commit is contained in:
Inada Naoki
2023-05-09 14:40:56 +09:00
committed by GitHub
parent 1f906e66c4
commit d2c07e8a0e
4 changed files with 15 additions and 29 deletions

View File

@ -5,7 +5,7 @@ on:
jobs: jobs:
build: build:
runs-on: ubuntu-20.04 runs-on: ubuntu-latest
steps: steps:
- name: Start MySQL - name: Start MySQL
run: | run: |
@ -13,29 +13,20 @@ jobs:
mysql_tzinfo_to_sql /usr/share/zoneinfo | mysql -uroot -proot mysql 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;" mysql -uroot -proot -e "CREATE USER 'scott'@'%' IDENTIFIED BY 'tiger'; GRANT ALL ON *.* TO scott;"
- uses: actions/cache@v2 - uses: actions/checkout@v3
with:
path: ~/.cache/pip
key: ${{ runner.os }}-django-pip-1
restore-keys: |
${{ runner.os }}-pip-
- name: Set up Python - name: Set up Python
uses: actions/setup-python@v2 uses: actions/setup-python@v4
with: with:
# https://www.mail-archive.com/django-updates@googlegroups.com/msg209056.html # https://www.mail-archive.com/django-updates@googlegroups.com/msg209056.html
python-version: "3.8" python-version: "3.8"
- uses: actions/checkout@v2
with:
fetch-depth: 2
- name: Install mysqlclient - name: Install mysqlclient
env: env:
PIP_NO_PYTHON_VERSION_WARNING: 1 PIP_NO_PYTHON_VERSION_WARNING: 1
PIP_DISABLE_PIP_VERSION_CHECK: 1 PIP_DISABLE_PIP_VERSION_CHECK: 1
run: | run: |
pip install -U pytest pytest-cov tblib pip install -r requirements.txt
pip install . pip install .
# pip install mysqlclient # Use stable version # pip install mysqlclient # Use stable version

View File

@ -6,29 +6,20 @@ on:
jobs: jobs:
build: build:
runs-on: ubuntu-20.04 runs-on: ubuntu-latest
strategy: strategy:
matrix: matrix:
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11"] python-version: ["3.8", "3.9", "3.10", "3.11"]
steps: steps:
- name: Start MySQL - name: Start MySQL
run: | run: |
sudo systemctl start mysql.service sudo systemctl start mysql.service
mysql -uroot -proot -e "CREATE DATABASE mysqldb_test" mysql -uroot -proot -e "CREATE DATABASE mysqldb_test"
- uses: actions/cache@v2 - uses: actions/checkout@v3
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-1
restore-keys: |
${{ runner.os }}-pip-
- uses: actions/checkout@v2
with:
fetch-depth: 2
- name: Set up Python ${{ matrix.python-version }} - name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2 uses: actions/setup-python@v4
with: with:
python-version: ${{ matrix.python-version }} python-version: ${{ matrix.python-version }}
@ -37,7 +28,7 @@ jobs:
PIP_NO_PYTHON_VERSION_WARNING: 1 PIP_NO_PYTHON_VERSION_WARNING: 1
PIP_DISABLE_PIP_VERSION_CHECK: 1 PIP_DISABLE_PIP_VERSION_CHECK: 1
run: | run: |
pip install -U coverage pytest pytest-cov pip install -r requirements.txt
python setup.py develop python setup.py develop
- name: Run tests - name: Run tests
@ -46,4 +37,4 @@ jobs:
run: | run: |
pytest --cov=MySQLdb tests pytest --cov=MySQLdb tests
- uses: codecov/codecov-action@v1 - uses: codecov/codecov-action@v3

View File

@ -21,7 +21,6 @@ classifiers:
Programming Language :: C Programming Language :: C
Programming Language :: Python Programming Language :: Python
Programming Language :: Python :: 3 Programming Language :: Python :: 3
Programming Language :: Python :: 3.7
Programming Language :: Python :: 3.8 Programming Language :: Python :: 3.8
Programming Language :: Python :: 3.9 Programming Language :: Python :: 3.9
Programming Language :: Python :: 3.10 Programming Language :: Python :: 3.10

5
requirements.txt Normal file
View File

@ -0,0 +1,5 @@
# This file is for GitHub Action
coverage
pytest
pytest-cov
tblib