Compare commits

...

1 Commits

Author SHA1 Message Date
Andrei Stoica d60634dff2 drone-ci testing 2023-05-16 07:15:46 -04:00
2 changed files with 67 additions and 0 deletions

66
.drone.yml Normal file
View File

@ -0,0 +1,66 @@
---
kind: pipeline
name: test
environment:
project_name: rgraph
trigger:
event:
include:
- pull_request
steps:
- name: db-up
image: docker/compose:alpine-1.29.2
environment:
POSTGRES_USER:
from_secret: TESTING_USER
POSTGRES_PASSWORD:
from_secret: TESTING_PASSWORD
POSTGRES_DB:
from_secret: TESTING_DB
volumes:
- name: docker_sock
path: /var/run/docker.sock
commands:
- docker-compose -p rgraph-test up -d
- name: requirements
image: python:3.10-alpine
commands:
- python -m venv .venv
- . .venv/bin/activate
- pip install -r requirements.txt
- name: build
image: python:3.10-alpine
commands:
- . .venv/bin/activate
- pip install .
- name: test
image: python:3.10-alpine
environment:
POSTGRES_USER:
from_secret: TESTING_USER
POSTGRES_PASSWORD:
from_secret: TESTING_PASSWORD
POSTGRES_DB:
from_secret: TESTING_DB
commands:
- hostip=$(ip route show | awk '/default/ {print $3}')
- export POSTGRES_URL=$hostip
- . .venv/bin/activate
- pytest
- name: db-cleanup
image: docker/compose:alpine-1.29.2
volumes:
- name: docker_sock
path: /var/run/docker.sock
commands:
- docker-compose -p rgraph-test down
- docker volume rm rgraph-test_dbdata
volumes:
- name: docker_sock
host:
path: /var/run/docker.sock

1
.gitignore vendored
View File

@ -10,3 +10,4 @@ htmlcov
*.pytest_cache/ *.pytest_cache/
*.egg-info/ *.egg-info/
dist/ dist/
build/