mirror of
https://github.com/PyMySQL/mysqlclient.git
synced 2025-08-14 18:12:35 +08:00
Add GitHub Actions for running SQLAlchemy tests
This commit is contained in:
45
.github/workflows/sqlalchemy.yaml
vendored
Normal file
45
.github/workflows/sqlalchemy.yaml
vendored
Normal file
@ -0,0 +1,45 @@
|
||||
name: SQLAlchemy compat test
|
||||
|
||||
on:
|
||||
push:
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-20.04
|
||||
steps:
|
||||
- name: Start MySQL
|
||||
run: |
|
||||
sudo systemctl start mysql.service
|
||||
mysql -uroot -proot -e "CREATE USER 'scott'@'%' IDENTIFIED BY 'tiger'; CREATE DATABASE test_schema CHARSET utf8mb4; GRANT ALL ON test_schema.* TO scott;"
|
||||
|
||||
- uses: actions/cache@v2
|
||||
with:
|
||||
path: ~/.cache/pip
|
||||
key: ${{ runner.os }}-sqla-pip-1
|
||||
restore-keys: |
|
||||
${{ runner.os }}-sqla-pip-
|
||||
|
||||
- name: Set up Python 3.10
|
||||
uses: actions/setup-python@v2
|
||||
with:
|
||||
python-version: "3.10"
|
||||
|
||||
- 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
|
||||
python setup.py develop
|
||||
|
||||
- name: Run SQLAlchemy test
|
||||
run: |
|
||||
wget https://files.pythonhosted.org/packages/69/2b/f0ee898c3270d965300ec30b0bf06e062c4cc92f35d17ae6046f429c5067/SQLAlchemy-1.4.25.tar.gz
|
||||
tar xf SQLAlchemy-1.4.25.tar.gz
|
||||
cd SQLAlchemy-1.4.25
|
||||
pip install .
|
||||
pytest --dburi=mysql://scott:tiger@127.0.0.1:3306/test?charset=utf8mb4 test/
|
Reference in New Issue
Block a user