add circleci config

This commit is contained in:
Danny Ryan 2019-03-18 13:06:45 -06:00
parent 839590b5f4
commit f41caa713b
No known key found for this signature in database
GPG Key ID: 2765A792E42CE07A
3 changed files with 49 additions and 3 deletions

46
.circleci/config.yml Normal file
View File

@ -0,0 +1,46 @@
# Python CircleCI 2.0 configuration file
version: 2
jobs:
build:
docker:
- image: circleci/python:3.6
working_directory: ~/repo
steps:
- checkout
# Download and cache dependencies
- restore_cache:
keys:
- v1-dependencies-{{ checksum "requirements.txt" }}
# fallback to using the latest cache if no exact match is found
- v1-dependencies-
- run:
name: install dependencies
command: |
python3 -m venv venv
. venv/bin/activate
pip install -r requirements.txt
- run:
name: build phase0 spec
command: make build/phase0
- save_cache:
paths:
- ./venv
key: v1-dependencies-{{ checksum "requirements.txt" }}
# run tests!
# this example uses Django's built-in test-runner
# other common Python testing frameworks include pytest and nose
# https://pytest.org
# https://nose.readthedocs.io
- run:
name: run tests
command: |
. venv/bin/activate
pytest tests
- store_artifacts:
path: test-reports
destination: test-reports

2
.gitignore vendored
View File

@ -2,3 +2,5 @@
/__pycache__
/venv
/.pytest_cache
build/phase0/spec.py

View File

@ -2,10 +2,8 @@ SPEC_DIR = ./specs
SCRIPT_DIR = ./scripts
BUILD_DIR = ./build
.PHONY: clean all
.PHONY: clean all $(BUILD_DIR)/phase0
$(BUILD_DIR)/phase0:
mkdir -p $@
python3 $(SCRIPT_DIR)/phase0/build_spec.py $(SPEC_DIR)/core/0_beacon-chain.md $@/spec.py
touch $(BUILD_DIR)/__init__.py $(BUILD_DIR)/phase0/__init__.py