-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
82 additions
and
59 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters