Skip to content

Commit

Permalink
Add Github action workflows for MySQL and SQLite.
Browse files Browse the repository at this point in the history
  • Loading branch information
Andreas Kaiser committed Nov 18, 2020
1 parent c28363b commit 6abb70c
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 15 deletions.
Original file line number Diff line number Diff line change
@@ -1,13 +1,10 @@
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions

name: Python package
name: MySQL

on:
push:
branches: [ $default-branch, "feature/upgrade_testing" ]
branches: [ master, testing, stable ]
pull_request:
branches: [ $default-branch ]
branches: [ master ]

jobs:
build:
Expand All @@ -17,6 +14,20 @@ jobs:
matrix:
python-version: [3.6, 3.7, 3.8, 3.9]

# Service containers to run with `runner-job`
services:
# Label used to access the service container
mysql:
image: mariadb:latest
env:
MYSQL_USER: kotti
MYSQL_PASSWORD: kotti
MYSQL_DATABASE: kotti
MYSQL_ROOT_PASSWORD: kotti
options: --health-cmd="mysqladmin ping" --health-interval=5s --health-timeout=2s --health-retries=3
ports:
- 3306

steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
Expand All @@ -27,6 +38,7 @@ jobs:
run: |
python -m pip install --upgrade pip
pip install -e ".[testing]"
pip install mysqlclient
# - name: Lint with flake8
# run: |
# # stop the build if there are Python syntax errors or undefined names
Expand All @@ -36,3 +48,6 @@ jobs:
- name: Test with pytest
run: |
pytest
env:
KOTTI_TEST_DB_STRING: mysql://kotti:kotti@mysql:3306/kotti

9 changes: 3 additions & 6 deletions .github/workflows/postgres.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions

name: Python package (PostgreSQL)
name: PostgreSQL

on:
push:
Expand Down Expand Up @@ -55,6 +52,6 @@ jobs:
- name: Test with pytest
run: |
pytest
env:
env:
KOTTI_TEST_DB_STRING: postgresql://postgres:postgres@localhost:5432/postgres

Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions

name: Python package
name: SQLite

on:
push:
Expand All @@ -27,6 +25,7 @@ jobs:
run: |
python -m pip install --upgrade pip
pip install -e ".[testing]"
pip install psycopg2-binary
# - name: Lint with flake8
# run: |
# # stop the build if there are Python syntax errors or undefined names
Expand All @@ -36,3 +35,4 @@ jobs:
- name: Test with pytest
run: |
pytest

0 comments on commit 6abb70c

Please sign in to comment.