From 472fa061520f49f571841606b8c2a89053f7f224 Mon Sep 17 00:00:00 2001 From: Ovv Date: Thu, 25 Jul 2019 19:02:38 +0200 Subject: [PATCH] Circleci config --- .circleci/config.yml | 39 ++++++++++++++++++++++++++------------- 1 file changed, 26 insertions(+), 13 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 9c70ab17..8614ab80 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1,8 +1,21 @@ version: 2 +workflows: + version: 2 + workflow: + jobs: + - test + - lint + - sentry: + requires: + - test + - lint + filters: + branches: + only: master + jobs: - build: - parallelism: 1 + test: &test-template working_directory: ~/app docker: - image: circleci/python:3.7.3-node-browsers @@ -12,14 +25,18 @@ jobs: POSTGRES_USER: main POSTGRES_DB: main POSTGRES_PASSWORD: main + environment: + TOXENV: ci steps: - checkout - restore_cache: keys: - 'venv-{{ checksum "requirements/base.txt" }}-{{ checksum "requirements/testing.txt" }}-{{ checksum "requirements/development.txt" }}-{{ checksum "requirements/production.txt" }}' + - venv- - restore_cache: keys: - 'tox-{{ checksum "requirements/base.txt" }}-{{ checksum "requirements/testing.txt" }}-{{ checksum "requirements/development.txt" }}-{{ checksum "requirements/production.txt" }}' + - tox- - run: | python3 -m venv .venv source .venv/bin/activate @@ -30,7 +47,7 @@ jobs: - .venv - run: | source .venv/bin/activate - tox -e ci -e lint + tox - save_cache: key: 'tox-{{ checksum "requirements/base.txt" }}-{{ checksum "requirements/testing.txt" }}-{{ checksum "requirements/development.txt" }}-{{ checksum "requirements/production.txt" }}' paths: @@ -38,6 +55,12 @@ jobs: - .mypy_cache - store_test_results: path: .tox/py37/artifacts/ + lint: + <<: *test-template + docker: + - image: circleci/python:3.7.3 + environment: + TOXENV: lint sentry: working_directory: ~/app docker: @@ -50,13 +73,3 @@ jobs: VERSION=$(sentry-cli releases propose-version) sentry-cli releases new -p website $VERSION sentry-cli releases set-commits --auto $VERSION - -workflows: - version: 2 - workflow: - jobs: - - build - - sentry: - filters: - branches: - only: master