Skip to content

Commit

Permalink
Update circle ci config with dev dependencies and multiple python ver…
Browse files Browse the repository at this point in the history
…sion tests
  • Loading branch information
hsahovic committed Oct 31, 2019
1 parent b0b7802 commit 52d0249
Showing 1 changed file with 83 additions and 60 deletions.
143 changes: 83 additions & 60 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,77 +5,100 @@
version: 2.1
orbs:
codecov: codecov/codecov@1.0.5
workflows:
version: 2
test:
jobs:
- test-3.5
- test-3.6
- test-3.7
jobs:
build:
docker:
# specify the version you desire here
# use `-browsers` prefix for selenium tests, e.g. `3.6.1-browsers`
- image: circleci/python:3.7.4
test-3.5: &test-template
build:
docker:
# specify the version you desire here
# use `-browsers` prefix for selenium tests, e.g. `3.6.1-browsers`
- image: circleci/python:3.5

# Specify service dependencies here if necessary
# CircleCI maintains a library of pre-built images
# documented at https://circleci.com/docs/2.0/circleci-images/
# - image: circleci/postgres:9.4

# Specify service dependencies here if necessary
# CircleCI maintains a library of pre-built images
# documented at https://circleci.com/docs/2.0/circleci-images/
# - image: circleci/postgres:9.4
working_directory: ~/repo

working_directory: ~/repo
steps:
- checkout

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-

# 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: install dependencies
command: |
python3 -m venv venv
. venv/bin/activate
pip install -r requirements.txt
- run:
name: install dev dependencies
command: |
python3 -m venv venv
. venv/bin/activate
pip install -r requirements-dev.txt
- save_cache:
paths:
- ./venv
key: v1-dependencies-{{ checksum "requirements.txt" }}
- save_cache:
paths:
- ./venv
key: v1-dependencies-{{ checksum "requirements.txt" }}

- run:
name: black
command: |
. venv/bin/activate
black src/ test/
- run:
name: black
command: |
. venv/bin/activate
black src/ test/
- run:
name: flake8
command: |
. venv/bin/activate
flake8 src/ test/
- run:
name: flake8
command: |
. venv/bin/activate
flake8 src/ test/
- run:
name: pyre
command: |
. venv/bin/activate
pyre check
- run:
name: pyre
command: |
. venv/bin/activate
pyre check
# 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 --cov=src/poke_env test/
# 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 --cov=src/poke_env test/
- run:
name: Converting coverage to xml
command: |
. venv/bin/activate
coverage xml
- run:
name: Converting coverage to xml
command: |
. venv/bin/activate
coverage xml
- codecov/upload:
file: coverage.xml
- codecov/upload:
file: coverage.xml
test-3.6:
<<: *test-template
docker:
- image: circleci/python:3.6
test-3.7:
<<: *test-template
docker:
- image: circleci/python:3.7

0 comments on commit 52d0249

Please sign in to comment.