Skip to content

Release: 2.0.0

Release: 2.0.0 #9

Workflow file for this run

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 .[dev]
- name: "Run tests with pytest"
run: |
export PYTHONPATH=.
./test/unit-test.sh
pystratum -vv 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