Last active
October 17, 2019 22:04
-
-
Save phrfpeixoto/59604bbeb4f01ba411addf5cc10e1c2a to your computer and use it in GitHub Desktop.
This file contains hidden or 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
image: python:3.7 | |
# Change pip's cache directory to be inside the project directory since we can | |
# only cache local items. | |
variables: | |
PIP_CACHE_DIR: "$CI_PROJECT_DIR/.cache/pip" | |
cache: | |
paths: | |
- .cache/pip | |
- venv/ | |
variables: | |
MYSQL_ROOT_PASSWORD: "ooops" | |
MYSQL_DATABASE: "database" | |
MYSQL_USER: "testuser" | |
MYSQL_PASSWORD: "testpass" | |
services: | |
- name: mysql:latest | |
command: ["--default-authentication-plugin=mysql_native_password"] | |
before_script: | |
- apt-get update && apt-get -y install sed default-mysql-client | |
- python -V # Print out python version for debugging | |
- pip install virtualenv | |
- virtualenv venv | |
- source venv/bin/activate | |
test: | |
script: | |
- cp testing.ini.sample testing.ini | |
- sed -i 's/localhost:3306/mysql:3306/g' testing.ini | |
- mysql -h mysql -u root -p$MYSQL_ROOT_PASSWORD -e 'CREATE DATABASE another' | |
- mysql -h mysql -u root -p$MYSQL_ROOT_PASSWORD -e "GRANT ALL PRIVILEGES ON another.* TO testuser@'%'" | |
- pip install -e ".[testing]" | |
- pytest --cov |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment