From e1ce13cc91fb30ad2f49f901d158504944bb53cb Mon Sep 17 00:00:00 2001 From: Inada Naoki Date: Tue, 19 Oct 2021 18:28:23 +0900 Subject: [PATCH] Add GitHub Actions for running SQLAlchemy tests --- .github/workflows/sqlalchemy.yaml | 45 +++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 .github/workflows/sqlalchemy.yaml diff --git a/.github/workflows/sqlalchemy.yaml b/.github/workflows/sqlalchemy.yaml new file mode 100644 index 0000000..abe2ad5 --- /dev/null +++ b/.github/workflows/sqlalchemy.yaml @@ -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/