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