Skip to content

MySQL backend

MySQL backend #51

Workflow file for this run

name: Tests
permissions:
pull-requests: write
on:
push:
branches: ["master"]
pull_request:
branches: ["master"]
jobs:
tests:
name: "Python ${{ matrix.python-version }}"
runs-on: "ubuntu-latest"
strategy:
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13"]
services:
postgres:
image: postgres:latest
env:
POSTGRES_USER: based
POSTGRES_PASSWORD: based
POSTGRES_DB: based
ports:
- 5432:5432
options: --health-cmd pg_isready --health-interval 5s --health-timeout 2s --health-retries 5
mysql:
image: mariadb:latest
env:
MARIADB_ROOT_PASSWORD: based
MARIADB_DB: based
ports:
- 5432:5432
steps:
- uses: "actions/checkout@v4"
- uses: "actions/setup-python@v5"
with:
python-version: "${{ matrix.python-version }}"
- name: "Install dependencies"
run: "make bootstrap"
- name: "Run linters"
run: "make lint"
- name: "Run tests"
env:
BASED_TEST_DB_URLS: |
postgresql://based:based@localhost:5432/based,
mysql://root:based@127.0.0.1:3306/based
run: "make test"
coverage:
name: "Test coverage"
runs-on: "ubuntu-latest"
services:
postgres:
image: postgres:latest
env:
POSTGRES_USER: based
POSTGRES_PASSWORD: based
POSTGRES_DB: based
ports:
- 5432:5432
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
mysql:
image: mariadb:latest
env:
MARIADB_ROOT_PASSWORD: based
MARIADB_DB: based
ports:
- 5432:5432
steps:
- uses: "actions/checkout@v4"
- uses: "actions/setup-python@v5"
with:
python-version: "3.12"
- name: "Install dependencies"
run: "make bootstrap"
- name: "Run tests"
env:
BASED_TEST_DB_URLS: |
postgresql://based:based@localhost:5432/based,
mysql://root:based@127.0.0.1:3306/based
run: "make test"
- name: Coverage report
uses: irongut/CodeCoverageSummary@v1.3.0
with:
filename: coverage.xml
badge: false
fail_below_min: true
format: markdown
hide_branch_rate: true
hide_complexity: true
indicators: true
output: both
thresholds: '100 100'
- name: Add coverage PR comment
uses: marocchino/sticky-pull-request-comment@v2
if: github.event_name == 'pull_request'
with:
recreate: true
path: code-coverage-results.md