Skip to content

Formatting

Formatting #15

Workflow file for this run

name: Tests
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
build:
runs-on: ubuntu-latest
services:
mysql:
image: mysql:8.4
env:
MYSQL_ROOT_PASSWORD: test_db
MYSQL_DATABASE: test_db
MYSQL_USER: test_db
MYSQL_PASSWORD: test_db
log_bin_trust_function_creators: 1
ports:
- 3306:3306
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=10
strategy:
matrix:
python-version: [ "3.9" ]
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
if [ -f requirements_test.txt ]; then pip install -r requirements_test.txt; fi
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
- name: Install module
run: |
pip install -e .
which protoc-gen-myprotosql
- name: Install protoc
uses: arduino/setup-protoc@v3
- name: Compile proto files
run: |
mkdir build
protoc --proto_path=proto --python_out=build --myprotosql_out=build ./proto/*
- name: Create the myprotosql stored procedures
run: |
mysql --host 127.0.0.1 --port 3306 -uroot -ptest_db test_db < ./build/install_myproto.sql
mysql --host 127.0.0.1 --port 3306 -uroot -ptest_db test_db < ./build/myproto_descriptors.sql
- name: Test with pytest
run: |
cd tests
pytest -m "not mysql5_7"