Skip to content

Commit e1ce13c

Browse files
committed
Add GitHub Actions for running SQLAlchemy tests
1 parent 267e784 commit e1ce13c

File tree

1 file changed

+45
-0
lines changed

1 file changed

+45
-0
lines changed

.github/workflows/sqlalchemy.yaml

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
name: SQLAlchemy compat test
2+
3+
on:
4+
push:
5+
6+
jobs:
7+
build:
8+
runs-on: ubuntu-20.04
9+
steps:
10+
- name: Start MySQL
11+
run: |
12+
sudo systemctl start mysql.service
13+
mysql -uroot -proot -e "CREATE USER 'scott'@'%' IDENTIFIED BY 'tiger'; CREATE DATABASE test_schema CHARSET utf8mb4; GRANT ALL ON test_schema.* TO scott;"
14+
15+
- uses: actions/cache@v2
16+
with:
17+
path: ~/.cache/pip
18+
key: ${{ runner.os }}-sqla-pip-1
19+
restore-keys: |
20+
${{ runner.os }}-sqla-pip-
21+
22+
- name: Set up Python 3.10
23+
uses: actions/setup-python@v2
24+
with:
25+
python-version: "3.10"
26+
27+
- uses: actions/checkout@v2
28+
with:
29+
fetch-depth: 2
30+
31+
- name: Install mysqlclient
32+
env:
33+
PIP_NO_PYTHON_VERSION_WARNING: 1
34+
PIP_DISABLE_PIP_VERSION_CHECK: 1
35+
run: |
36+
pip install -U pytest pytest-cov
37+
python setup.py develop
38+
39+
- name: Run SQLAlchemy test
40+
run: |
41+
wget https://files.pythonhosted.org/packages/69/2b/f0ee898c3270d965300ec30b0bf06e062c4cc92f35d17ae6046f429c5067/SQLAlchemy-1.4.25.tar.gz
42+
tar xf SQLAlchemy-1.4.25.tar.gz
43+
cd SQLAlchemy-1.4.25
44+
pip install .
45+
pytest --dburi=mysql://scott:[email protected]:3306/test?charset=utf8mb4 test/

0 commit comments

Comments
 (0)