saving work

drew/add-ci-setup
Drew Bednar 1 year ago
parent b1df639e37
commit 7ac43519c7

@ -0,0 +1,23 @@
kind: pipeline
type: docker
name: CI Test Pipeline
steps:
- name: greeting
image: alpine
commands:
- echo "Welcome to drone\n"
- name: Unit Tests
image: python:3.8-buster
commands:
- bash -c './ci_scripts/run_unit_tests.sh'
trigger:
event:
exclude:
- pull_request
# Secrets used to pull private images
image_pull_secrets:
- dockerconfigjson

@ -7,4 +7,4 @@ filter_files = true
[tool.black] [tool.black]
line-length = 120 line-length = 120
skip-string-normalization = true skip-string-normalization = true
exclude = "(^/\\.git|^/env/|^/venv/)" exclude = "(^/\\.git|^/env/|^/venv/|^/node_modules/)"

@ -0,0 +1,9 @@
#! /usr/bin/env bash
set -ex
source "$(dirname "$0")/_common.sh"
_setup_env
${VIRTUAL_ENV}/bin/python -m pytest -vv --cov "$@"

@ -4,7 +4,19 @@
# setting -o pipefail sets the exit code of a pipeline to that of the rightmost command to exit with a non-zero status, or to zero if all commands of the pipeline exit successfully. # setting -o pipefail sets the exit code of a pipeline to that of the rightmost command to exit with a non-zero status, or to zero if all commands of the pipeline exit successfully.
set -eo pipefail set -eo pipefail
if [ -z "$VIRTUAL_ENV" ]; then function _setup_env() {
# build a virtual env and install
if [ -z $VIRTUAL_ENV ]; then
python3 -m venv env
source env/bin/activate
fi
if [ "${DRONE}" == "true" ]; then
_setup_env
fi
if [ -z "${VIRTUAL_ENV}" ]; then
echo "warning: you are not in a virtualenv" echo "warning: you are not in a virtualenv"
exit 1 exit 1
fi fi

@ -0,0 +1,9 @@
#! /usr/bin/env bash
set -ex
source "$(dirname "$0")/_common.sh"
_setup_env
${VIRTUAL_ENV}/bin/python -m pytest -vv --cov "$@"
Loading…
Cancel
Save