Add Python 3.12 to test matrix #154
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: Lint and Test Package | |
on: | |
push: | |
branches: | |
- dev | |
- master | |
pull_request: | |
branches: | |
- dev | |
- master | |
types: | |
- opened | |
- synchronize | |
- reopened | |
- ready_for_review | |
workflow_dispatch: | |
permissions: | |
contents: read | |
jobs: | |
lint: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Python | |
uses: actions/setup-python@v3 | |
- name: Set up Python | |
uses: actions/setup-python@v3 | |
with: | |
python-version: '3.x' | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
python -m pip install -e .[dev,test] | |
- name: Lint package | |
run: mypy . | |
test: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12"] | |
services: | |
postgres: | |
image: postgres:15-alpine | |
env: | |
POSTGRES_USER: postgres | |
POSTGRES_PASSWORD: pass | |
POSTGRES_DB: test_db | |
ports: | |
- 5432:5432 | |
mariadb: | |
image: mariadb:11-jammy | |
env: | |
MARIADB_DATABASE: test_db | |
MYSQL_ROOT_PASSWORD: pass | |
ports: | |
- 3306:3306 | |
env: | |
POSTGRES_DSN: postgresql://postgres:[email protected]:5432/test_db | |
MYSQL_DSN: mysql://root:[email protected]:3306/test_db | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install dependencies | |
run: | | |
sudo apt update && sudo apt install -qy python3-dev default-libmysqlclient-dev build-essential | |
python -m pip install --upgrade pip | |
python -m pip install -e .[dev,test,ci] | |
- name: Test package | |
run: pytest |