Skip to content

CI

CI #14

Workflow file for this run

name: CI
on:
push:
branches:
- main
- "[0-9]+-[0-9]+-stable"
pull_request:
branches:
- main
schedule:
- cron: "0 2 * * 0"
jobs:
test:
strategy:
matrix:
python: ["3.12", "3.11", "3.10"]
runs-on: ubuntu-latest
container: python:${{matrix.python}}
steps:
- uses: actions/checkout@v4
- name: Install Dependencies
run: |
apt-get update
apt-get install -y unixodbc-dev
pip install . .[mssql] pytest
- name: Run Unit Tests
run: pytest tests/
integration-mssql:
# The ubuntu version here needs to be synced with the setup instructions in /tests_integration/mssql/install_mssql.sh
# as different versions of mssql have different setup instructions https://learn.microsoft.com/en-us/sql/linux/quickstart-install-connect-ubuntu?view=sql-server-ver16
runs-on: ubuntu-20.04
env:
MSSQL_PID: developer
MSSQL_SA_PASSWORD: pASSw0rd
PYNONYMIZER_DB_USER: sa
PYNONYMIZER_DB_PASSWORD: pASSw0rd
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.12'
- name: Setup MSSQL
run: bash tests_integration/install_mssql.sh
- name: Setup test env
run: python -m pip install . .[mssql] pytest
- run: pytest -s tests_integration/mssql
integration-mysql:
services:
db:
image: mariadb:10
env:
MYSQL_ROOT_PASSWORD: password
ports:
- 3306
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
runs-on: ubuntu-latest
container: python:3.12
env:
PYNONYMIZER_DB_HOST: db
PYNONYMIZER_DB_USER: root
PYNONYMIZER_DB_PASSWORD: password
steps:
- uses: actions/checkout@v4
- name: Setup
run: |
apt-get update
apt-get install -y mariadb-client
pip install . pytest
- run: pytest -s tests_integration/mysql
integration-postgres:
services:
db:
image: postgres:10.10
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: password
ports:
- 5432/tcp
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
runs-on: ubuntu-latest
container: python:3.12
env:
PYNONYMIZER_DB_HOST: db
PYNONYMIZER_DB_USER: postgres
PYNONYMIZER_DB_PASSWORD: password
steps:
- uses: actions/checkout@v4
- name: Setup
run: |
apt-get update
apt-get install -y postgresql-client
pip install . pytest
- run: pytest -s tests_integration/postgres