Skip to content

Merge branch 'master' into with_tests #18

Merge branch 'master' into with_tests

Merge branch 'master' into with_tests #18

Workflow file for this run

name: python-build
on:
push:
paths:
- 'python/**'
- '.github/workflows/python-build.yml'
pull_request:
paths:
- 'python/**'
- '.github/workflows/python-build.yml'
jobs:
build:
defaults:
run:
working-directory: ./python
runs-on: ubuntu-latest
env:
DB_USER: root
DB_OLD_PASSWORD: root
DB_PASSWORD: mysql
strategy:
matrix:
python-version: ["3.8", "3.10", "3.12"]
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Start MYSQL and import DB
run: |
sudo systemctl start mysql
mysqladmin --user=${{ env.DB_USER }} --password=${{ env.DB_OLD_PASSWORD }} version
mysqladmin --user=${{ env.DB_USER }} --password=${{ env.DB_OLD_PASSWORD }} password ${{ env.DB_PASSWORD }}
mysql -u${{ env.DB_USER }} -p${{ env.DB_PASSWORD }} < ${GITHUB_WORKSPACE}/database/initDatabase.sql
- name: Install MySQL odbc driver
run: |
wget https://repo.mysql.com/apt/ubuntu/pool/mysql-8.0/m/mysql-community/mysql-community-client-plugins_8.0.32-1ubuntu22.04_amd64.deb
sudo dpkg -i mysql-community-client-plugins_8.0.32-1ubuntu22.04_amd64.deb
wget https://dev.mysql.com/get/Downloads/Connector-ODBC/8.0/mysql-connector-odbc_8.0.32-1ubuntu22.04_amd64.deb
sudo dpkg -i mysql-connector-odbc_8.0.32-1ubuntu22.04_amd64.deb
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Set up dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: Test
run: PYTHONPATH=src python -m pytest