docs: Fix typo import getuser() #696
Workflow file for this run
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
name: Run tests on MySQL | |
on: | |
push: | |
branches: [ main ] | |
pull_request: | |
branches: [ main ] | |
jobs: | |
tests-mysql-linux: | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
python-version: [3.8, 3.9, "3.10", "3.11", "3.12", pypy-3.8] | |
env: | |
OS: ubuntu-latest | |
PYTHON: ${{ matrix.python-version }} | |
# Service containers to run with `container-job` | |
services: | |
mysql: | |
image: mysql | |
env: | |
MYSQL_ALLOW_EMPTY_PASSWORD: yes | |
MYSQL_DATABASE: tests | |
ports: | |
- 3333:3306 | |
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3 | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: ankane/setup-mysql@v1 | |
with: | |
mysql-version: 8.0 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Check MySQL Version | |
run: mysqld --version | |
- name: Run test | |
uses: fizyk/actions-reuse/.github/actions/[email protected] | |
with: | |
python-version: ${{ matrix.python-version }} | |
command: pytest -n 0 -k "not mysqlnoproc" --cov-report=xml --mysql-user=root | |
- name: Run xdist test | |
uses: fizyk/actions-reuse/.github/actions/[email protected] | |
with: | |
python-version: ${{ matrix.python-version }} | |
command: pytest -n 0 -k "not mysqlnoproc" --cov-report=xml:coverage-xdist.xml --mysql-user=root | |
- name: Run noproc test | |
uses: fizyk/actions-reuse/.github/actions/[email protected] | |
with: | |
python-version: ${{ matrix.python-version }} | |
command: pytest -n 0 -k mysqlnoproc --cov-report=xml:coverage-noproc.xml --mysql-host="127.0.0.1" --mysql-port=3333 | |
- name: Upload coverage to Codecov | |
uses: codecov/[email protected] | |
with: | |
flags: linux,mysql | |
env_vars: OS, PYTHON | |
fail_ci_if_error: false | |
token: ${{ secrets.CODECOV_TOKEN }} | |
tests-mariadb-linux-11: | |
needs: [ tests-mysql-linux ] | |
uses: ./.github/workflows/tests-mariadb-linux.yml | |
with: | |
mariadb: "11.4" | |
python-versions: '["3.10", "3.11", "3.12"]' | |
tests-mariadb-linux-10_11: | |
needs: [ tests-mariadb-linux-11 ] | |
uses: ./.github/workflows/tests-mariadb-linux.yml | |
with: | |
mariadb: 10.11 | |
python-versions: '["3.11", "3.12"]' | |
tests-mysql-macosx: | |
runs-on: macos-latest | |
needs: [tests-mysql-linux] | |
strategy: | |
fail-fast: false | |
matrix: | |
python-version: ["3.10", "3.11", "3.12"] | |
env: | |
OS: macos-latest | |
PYTHON: ${{ matrix.python-version }} | |
PKG_CONFIG_PATH: /usr/local/opt/[email protected]/lib/pkgconfig | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: ankane/setup-mysql@v1 | |
with: | |
mysql-version: 8.0 | |
- name: Check MySQL Version | |
run: mysqld --version | |
- name: Run test | |
uses: fizyk/actions-reuse/.github/actions/[email protected] | |
with: | |
python-version: ${{ matrix.python-version }} | |
command: pytest -n 0 -k "not mysqlnoproc" --cov-report=xml --mysql-user=root --basetemp=/tmp/pytest_mysql | |
cache: false | |
tests-mariadb-macosx: | |
runs-on: macos-latest | |
needs: [tests-mysql-macosx, tests-mariadb-linux-11] | |
strategy: | |
fail-fast: false | |
matrix: | |
python-version: ["3.12"] | |
env: | |
OS: macos-latest | |
PYTHON: ${{ matrix.python-version }} | |
PKG_CONFIG_PATH: /usr/local/opt/[email protected]/lib/pkgconfig | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: ankane/setup-mariadb@v1 | |
with: | |
mariadb-version: "11.4" | |
- name: Install pkg-config | |
run: brew install pkg-config | |
- name: Check MySQL Version | |
run: mysqld --version | |
- name: Run test | |
uses: fizyk/actions-reuse/.github/actions/[email protected] | |
with: | |
python-version: ${{ matrix.python-version }} | |
command: pytest --mysql-user=$USER -n 0 -k "not mysqlnoproc" --cov-report=xml --basetemp=/tmp/pytest_mysql | |
cache: false |