Skip to content

Commit

Permalink
Add lint job
Browse files Browse the repository at this point in the history
Update cache key
  • Loading branch information
hwwhww committed May 7, 2020
1 parent 779b156 commit df39ad1
Showing 1 changed file with 37 additions and 3 deletions.
40 changes: 37 additions & 3 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,11 @@ jobs:
build:
docker:
- image: circleci/python:3.8
working_directory: ~/repo
steps:
- checkout
- restore_cache:
key: deps1-{{ .Branch }}-{{ checksum "requirements.txt" }}-{{ .Branch }}-{{ checksum "requirements_test.txt" }}
key: deps2-{{ arch }}-{{ .Branch }}-{{ checksum "requirements.txt" }}-{{ checksum "requirements_test.txt" }}
- run:
name: Install requirements
command: |
Expand All @@ -15,9 +16,17 @@ jobs:
pip install -r requirements.txt
pip install -r requirements_test.txt
- save_cache:
key: deps1-{{ .Branch }}-{{ checksum "requirements.txt" }}-{{ .Branch }}-{{ checksum "requirements_test.txt" }}
key: deps2-{{ arch }}-{{ .Branch }}-{{ checksum "requirements.txt" }}-{{ checksum "requirements_test.txt" }}
paths:
- "venv"
- ./venv
pytest:
docker:
- image: circleci/python:3.8
working_directory: ~/repo
steps:
- checkout
- restore_cache:
key: deps2-{{ arch }}-{{ .Branch }}-{{ checksum "requirements.txt" }}-{{ checksum "requirements_test.txt" }}
- run:
name: Run tests
command: |
Expand All @@ -29,3 +38,28 @@ jobs:
destination: tr1
- store_test_results:
path: test-reports/
lint:
docker:
- image: circleci/python:3.8
working_directory: ~/repo
steps:
- checkout
- restore_cache:
key: deps2-{{ arch }}-{{ .Branch }}-{{ checksum "requirements.txt" }}-{{ checksum "requirements_test.txt" }}
- run:
name: Run linter
command: |
. venv/bin/activate
flake8 --config=flake8.ini ./src && mypy --config-file mypy.ini -p src
workflows:
version: 2.1
all_test:
jobs:
- build
- pytest:
requires:
- build
- lint:
requires:
- build

0 comments on commit df39ad1

Please sign in to comment.