mirror of
https://github.com/PyMySQL/mysqlclient.git
synced 2026-03-13 08:00:02 +08:00
57 lines
1.5 KiB
YAML
57 lines
1.5 KiB
YAML
name: Test
|
|
|
|
on:
|
|
push:
|
|
branches: ["main"]
|
|
pull_request:
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: ubuntu-latest
|
|
strategy:
|
|
matrix:
|
|
python-version: ["3.8", "3.9", "3.10", "3.11"]
|
|
include:
|
|
- python-version: "3.11"
|
|
mariadb: 1
|
|
steps:
|
|
- if: ${{ matrix.mariadb }}
|
|
name: Start MariaDB
|
|
# https://github.com/actions/runner-images/blob/9d9b3a110dfc98100cdd09cb2c957b9a768e2979/images/linux/scripts/installers/mysql.sh#L10-L13
|
|
run: |
|
|
docker pull mariadb:10.11
|
|
docker run -d -e MARIADB_ROOT_PASSWORD=root -p 3306:3306 --rm --name mariadb mariadb:10.11
|
|
sudo apt-get -y install libmariadb-dev
|
|
mysql --version
|
|
mysql -uroot -proot -h127.0.0.1 -e "CREATE DATABASE mysqldb_test"
|
|
|
|
- if: ${{ !matrix.mariadb }}
|
|
name: Start MySQL
|
|
run: |
|
|
sudo systemctl start mysql.service
|
|
mysql --version
|
|
mysql -uroot -proot -e "CREATE DATABASE mysqldb_test"
|
|
|
|
- uses: actions/checkout@v3
|
|
|
|
- name: Set up Python ${{ matrix.python-version }}
|
|
uses: actions/setup-python@v4
|
|
with:
|
|
python-version: ${{ matrix.python-version }}
|
|
|
|
- name: Install dependencies
|
|
env:
|
|
PIP_NO_PYTHON_VERSION_WARNING: 1
|
|
PIP_DISABLE_PIP_VERSION_CHECK: 1
|
|
run: |
|
|
pip install -r requirements.txt
|
|
pip install .
|
|
|
|
- name: Run tests
|
|
env:
|
|
TESTDB: actions.cnf
|
|
run: |
|
|
pytest --cov=MySQLdb tests
|
|
|
|
- uses: codecov/codecov-action@v3
|