mirror of
https://github.com/aljazceru/python-teos.git
synced 2026-01-21 15:24:22 +01:00
86 lines
2.7 KiB
YAML
86 lines
2.7 KiB
YAML
# Python CircleCI 2.0 configuration file
|
|
#
|
|
# Check https://circleci.com/docs/2.0/language-python/ for more details
|
|
#
|
|
version: 2
|
|
jobs:
|
|
build:
|
|
machine:
|
|
image: ubuntu-1604:201903-01
|
|
|
|
# Specify service dependencies here if necessary
|
|
# CircleCI maintains a library of pre-built images
|
|
# documented at https://circleci.com/docs/2.0/circleci-images/
|
|
# - image: circleci/postgres:9.4
|
|
|
|
working_directory: ~/repo
|
|
|
|
steps:
|
|
- checkout
|
|
|
|
# Get bitcoin_sandbox
|
|
- run:
|
|
name: get bitcoin_sandbox
|
|
command: git clone --single-branch --branch ln https://github.com/sr-gi/bitcoin_sandbox.git
|
|
|
|
# Download and cache dependencies
|
|
- restore_cache:
|
|
keys:
|
|
- v2-dependencies-{{ checksum "pisa/requirements.txt" }}-{{ checksum "pisa/requirements-dev.txt" }}-{{ checksum "apps/cli/requirements-dev.txt" }}-{{ checksum "bitcoin_sandbox/requirements.txt" }}
|
|
# fallback to using the latest cache if no exact match is found
|
|
- v2-dependencies-
|
|
|
|
- run:
|
|
name: install dependencies
|
|
command: |
|
|
pyenv local 3.7.0
|
|
python3 -m venv venv
|
|
. venv/bin/activate
|
|
sudo pip install --upgrade pip
|
|
pip install -r pisa/requirements.txt
|
|
pip install -r pisa/requirements-dev.txt
|
|
pip install -r apps/cli/requirements-dev.txt
|
|
pip install -r bitcoin_sandbox/requirements.txt
|
|
|
|
- save_cache:
|
|
paths:
|
|
- ./venv
|
|
key: v2-dependencies-{{ checksum "pisa/requirements.txt" }}-{{ checksum "pisa/requirements-dev.txt" }}-{{ checksum "apps/cli/requirements-dev.txt" }}-{{ checksum "bitcoin_sandbox/requirements.txt" }}
|
|
|
|
# Build docker env for E2E testing
|
|
- run:
|
|
name: build bitcoin_sandbox
|
|
command: |
|
|
cp test/pisa/e2e/bitcoin.conf bitcoin_sandbox/
|
|
cp test/pisa/e2e/conf.py bitcoin_sandbox/bitcoin_sandbox/
|
|
. venv/bin/activate
|
|
cd bitcoin_sandbox && python -m bitcoin_sandbox.run_scenarios
|
|
|
|
|
|
# Run unit tests
|
|
- run:
|
|
name: create config
|
|
command: cp pisa/sample_conf.py pisa/conf.py
|
|
|
|
- run:
|
|
name: run pisa unit tests
|
|
command: |
|
|
. venv/bin/activate
|
|
pytest test/pisa/unit/
|
|
|
|
- run:
|
|
name: run common unit tests
|
|
command: |
|
|
. venv/bin/activate
|
|
pytest test/common/unit
|
|
|
|
- run:
|
|
name: run cli unit tests
|
|
command: |
|
|
. venv/bin/activate
|
|
pytest test/apps/cli/unit
|
|
|
|
# - store_artifacts:
|
|
# path: test-reports
|
|
# destination: test-reports
|