Skip to content

Commit

Permalink
Use GitHub actions.
Browse files Browse the repository at this point in the history
  • Loading branch information
prwater committed May 13, 2024
1 parent a57f675 commit 721d985
Show file tree
Hide file tree
Showing 4 changed files with 82 additions and 59 deletions.
74 changes: 74 additions & 0 deletions .github/workflows/unit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
on:
- "pull_request"
- "push"

name: "unit"

permissions:
contents: "read"

jobs:
tests:
name: "Tests"
runs-on: "ubuntu-latest"

strategy:
fail-fast: false
matrix:
python-version:
- "3.9"
- "3.10"
- "3.11"
- "3.12"
mysql-version:
- "mysql-5.7"
- "mysql-8.0"
- "mariadb-10.4"
- "mariadb-10.5"
- "mariadb-10.6"
- "mariadb-10.11"

steps:
- uses: "actions/checkout@v4"

- name: "Set up Python ${{ matrix.python-version }}"
uses: "actions/setup-python@v5"
with:
python-version: "${{ matrix.python-version }}"

- name: "Display Python version"
run: "python -c 'import sys; print(sys.version)'"

- name: "Install MySQL or MariaDB"
uses: "shogo82148/actions-setup-mysql@v1"
with:
mysql-version: "${{ matrix.mysql-version }}"

- name: "Install timezone info"
run: "mysql_tzinfo_to_sql /usr/share/zoneinfo | mysql -u root -h 127.0.0.1 mysql"

- name: "Trust function creators (for MySQL 8.x)"
run: "mysql -u root -h 127.0.0.1 -e 'SET GLOBAL log_bin_trust_function_creators = 1'"

- name: "Install dependencies"
run: |
python -m pip install --upgrade pip
pip install coverage
pip install .
- name: "Run tests with pytest"
run: |
cat test/ddl/create_tables.sql | mysql -utest -ptest test
export PYTHONPATH=.
./venv/bin/pystratum stratum test/etc/stratum.cfg
rm test/etc/routines.json
python -m coverage run -m unittest discover -s test -p *Test.py
python -m coverage xml
- name: "Upload to Codecov"
uses: "codecov/codecov-action@v4"
with:
fail_ci_if_error: true
files: "test/coverage.xml"
token: ${{ secrets.CODECOV_TOKEN }}
verbose: true
23 changes: 0 additions & 23 deletions .scrutinizer.yml

This file was deleted.

28 changes: 0 additions & 28 deletions .travis.yml

This file was deleted.

16 changes: 8 additions & 8 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@ PyStratum-MySQL

MySQL & MariaDB Backend for PyStratum

+-----------------------------------------------------------------------------------------------------------------------------+----------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------+
| Social | Release | Tests | Code |
+=============================================================================================================================+====================================================================================================+=======================================================================================================+============================================================================================================+
| .. image:: https://badges.gitter.im/SetBased/py-stratum.svg | .. image:: https://badge.fury.io/py/PyStratum-MySQL.svg | .. image:: https://travis-ci.org/DatabaseStratum/py-stratum-mysql.svg?branch=master | .. image:: https://scrutinizer-ci.com/g/DatabaseStratum/py-stratum-mysql/badges/quality-score.png?b=master |
| :target: https://gitter.im/SetBased/py-stratum?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge | :target: https://badge.fury.io/py/PyStratum-MySQL | :target: https://travis-ci.org/DatabaseStratum/py-stratum-mysql | :target: https://scrutinizer-ci.com/g/DatabaseStratum/py-stratum-mysql/?branch=master |
| | | .. image:: https://scrutinizer-ci.com/g/DatabaseStratum/py-stratum-mysql/badges/coverage.png?b=master | |
| | | :target: https://scrutinizer-ci.com/g/DatabaseStratum/py-stratum-mysql/?branch=master | |
+-----------------------------------------------------------------------------------------------------------------------------+----------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------+
+-----------------------------------------------------------------------------------------------------------------------------+----------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------+
| Social | Release | Tests | Code |
+=============================================================================================================================+====================================================================================================+=====================================================================================================+============================================================================================================+
| .. image:: https://badges.gitter.im/SetBased/py-stratum.svg | .. image:: https://badge.fury.io/py/PyStratum-MySQL.svg | .. image:: https://github.com/DatabaseStratum/py-stratum-mysql/actions/workflows/unit.yml/badge.svg | .. image:: https://scrutinizer-ci.com/g/DatabaseStratum/py-stratum-mysql/badges/quality-score.png?b=master |
| :target: https://gitter.im/SetBased/py-stratum?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge | :target: https://badge.fury.io/py/PyStratum-MySQL | :target: https://github.com/DatabaseStratum/py-stratum-mysql/actions/workflows/unit.yml | :target: https://scrutinizer-ci.com/g/DatabaseStratum/py-stratum-mysql/?branch=master |
| | | .. image:: https://codecov.io/gh/DatabaseStratum/py-stratum-mysql/branch/master/graph/badge.svg | |
| | | :target: https://codecov.io/gh/DatabaseStratum/py-stratum-mysql | |
+-----------------------------------------------------------------------------------------------------------------------------+----------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------+

Overview
========
Expand Down

0 comments on commit 721d985

Please sign in to comment.