Skip to content
This repository was archived by the owner on Aug 19, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 51 additions & 0 deletions .github/workflows/test-suite.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
---
name: Test Suite

on:
push:
branches: ["master"]
pull_request:
branches: ["master"]

jobs:
tests:
name: "Python ${{ matrix.python-version }}"
runs-on: "ubuntu-latest"

strategy:
matrix:
python-version: ["3.6", "3.7", "3.8"]

services:
mysql:
image: mysql:5.7
env:
MYSQL_USER: username
MYSQL_PASSWORD: password
MYSQL_ROOT_PASSWORD: password
MYSQL_DATABASE: testsuite
ports:
- 3306:3306
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3

postgres:
image: postgres:10.8
env:
POSTGRES_USER: username
POSTGRES_PASSWORD: password
POSTGRES_DB: testsuite
ports:
- 5432:5432
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5

steps:
- uses: "actions/checkout@v2"
- uses: "actions/setup-python@v1"
with:
python-version: "${{ matrix.python-version }}"
- name: "Install dependencies"
run: "scripts/install"
- name: "Run tests"
env:
TEST_DATABASE_URLS: "sqlite:///testsuite, mysql://username:password@localhost:3306/testsuite, postgresql://username:password@localhost:5432/testsuite, postgresql+aiopg://username:password@localhost:5432/testsuite"
run: "scripts/test"
29 changes: 0 additions & 29 deletions .travis.yml

This file was deleted.

23 changes: 9 additions & 14 deletions scripts/install
Original file line number Diff line number Diff line change
@@ -1,24 +1,19 @@
#!/bin/sh -e

# Use the Python executable provided from the `-p` option, or a default.
[[ $1 = "-p" ]] && PYTHON=$2 || PYTHON="python3"

MIN_VERSION="(3, 6)"
VERSION_OK=`"$PYTHON" -c "import sys; print(sys.version_info[0:2] >= $MIN_VERSION and '1' or '');"`

if [[ -z "$VERSION_OK" ]] ; then
PYTHON_VERSION=`"$PYTHON" -c "import sys; print('%s.%s' % sys.version_info[0:2]);"`
DISP_MIN_VERSION=`"$PYTHON" -c "print('%s.%s' % $MIN_VERSION)"`
echo "ERROR: Python $PYTHON_VERSION detected, but $DISP_MIN_VERSION+ is required."
echo "Please upgrade your Python distribution to install Databases."
exit 1
fi
[ "$1" = "-p" ] && PYTHON=$2 || PYTHON="python3"

REQUIREMENTS="requirements.txt"
VENV="venv"
PIP="$VENV/bin/pip"

set -x
"$PYTHON" -m venv "$VENV"

if [ -z "$GITHUB_ACTIONS" ]; then
"$PYTHON" -m venv "$VENV"
PIP="$VENV/bin/pip"
else
PIP="pip"
fi

"$PIP" install -r "$REQUIREMENTS"
"$PIP" install -e .
3 changes: 0 additions & 3 deletions scripts/test
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,6 @@ if [ -d 'venv' ] ; then
export PREFIX="venv/bin/"
fi

export VERSION_SCRIPT="import sys; print('%s.%s' % sys.version_info[0:2])"
export PYTHON_VERSION=`python -c "$VERSION_SCRIPT"`

if [ -z "$TEST_DATABASE_URLS" ] ; then
echo "Variable TEST_DATABASE_URLS must be set."
exit 1
Expand Down