From f41caa713b167d986acfdbeb61fb9f1bb8d1ce81 Mon Sep 17 00:00:00 2001 From: Danny Ryan Date: Mon, 18 Mar 2019 13:06:45 -0600 Subject: [PATCH] add circleci config --- .circleci/config.yml | 46 ++++++++++++++++++++++++++++++++++++++++++++ .gitignore | 2 ++ Makefile | 4 +--- 3 files changed, 49 insertions(+), 3 deletions(-) create mode 100644 .circleci/config.yml diff --git a/.circleci/config.yml b/.circleci/config.yml new file mode 100644 index 000000000..98d2367c9 --- /dev/null +++ b/.circleci/config.yml @@ -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 \ No newline at end of file diff --git a/.gitignore b/.gitignore index 5e19cd2a5..f9a966cea 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,5 @@ /__pycache__ /venv /.pytest_cache + +build/phase0/spec.py diff --git a/Makefile b/Makefile index 745f8f901..8be65fd44 100644 --- a/Makefile +++ b/Makefile @@ -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