[pre-commit.ci] pre-commit autoupdate #284
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: Tests | |
on: | |
pull_request: | |
branches: | |
- release | |
- main | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
jobs: | |
test-sqlite: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
python: ["3.9", "3.10", "3.11", "3.12"] | |
database: ["sqlite"] | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
- name: Set up Python | |
id: setup-python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python }} | |
- name: Install dependencies | |
id: install-dependencies | |
run: | | |
python -m pip install --upgrade pip | |
python -m pip install tox tox-gh-actions | |
- name: Test with tox | |
id: test-with-tox | |
run: | | |
tox | |
env: | |
DATABASE: ${{ matrix.database }} | |
test-postgres: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
python: ["3.12"] | |
database: ["postgres"] | |
services: | |
postgres: | |
image: postgres | |
env: | |
POSTGRES_USER: postgres | |
POSTGRES_PASSWORD: postgres | |
POSTGRES_DB: postgres | |
ports: | |
- 5432:5432 | |
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5 | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
- name: Set up Python | |
id: setup-python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python }} | |
- name: Install dependencies | |
id: install-dependencies | |
run: | | |
python -m pip install --upgrade pip | |
python -m pip install tox tox-gh-actions | |
- name: Test with tox | |
id: test-with-tox | |
run: | | |
tox | |
env: | |
DB_NAME: postgres | |
DB_USER: postgres | |
DB_PASSWORD: postgres | |
DB_HOST: localhost | |
DB_PORT: 5432 | |
DATABASE: ${{ matrix.database }} | |
test-mysql: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
python: ["3.12"] | |
database: ["mysql"] | |
services: | |
mariadb: | |
image: mysql:8.0 | |
env: | |
MYSQL_ROOT_PASSWORD: mysql | |
options: >- | |
--health-cmd "mysqladmin ping" | |
--health-interval 10s | |
--health-timeout 5s | |
--health-retries 5 | |
ports: | |
- 3306:3306 | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
- name: Set up Python | |
id: setup-python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python }} | |
- name: Install dependencies | |
id: install-dependencies | |
run: | | |
python -m pip install --upgrade pip | |
python -m pip install tox tox-gh-actions | |
- name: Test with tox | |
id: test-with-tox | |
run: | | |
tox | |
env: | |
DB_NAME: mysql | |
DB_USER: root | |
DB_PASSWORD: mysql | |
DB_HOST: 127.0.0.1 | |
DB_PORT: 3306 | |
DATABASE: ${{ matrix.database }} |