Skip to content

Commit

Permalink
Support CI on circleci
Browse files Browse the repository at this point in the history
  • Loading branch information
my8100 committed Jul 6, 2019
1 parent 349613e commit 02a18b4
Show file tree
Hide file tree
Showing 6 changed files with 1,082 additions and 0 deletions.
94 changes: 94 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
# Python CircleCI 2.1 configuration file
version: 2.1

orbs:
codecov: codecov/codecov@1.0.2

jobs:
py37: &test-template
docker:
- image: circleci/python:3.7

working_directory: ~/repo

parameters:
is-py27:
type: boolean
default: false

steps:
- run:
name: Install telnet
command: |
sudo apt-get update && sudo apt-get install telnet
- checkout

- when:
condition: <<parameters.is-py27>>
steps:
- run:
name: Create virtual env in PY2
command: |
virtualenv ./venv
- unless:
condition: <<parameters.is-py27>>
steps:
- run:
name: Create virtual env in PY3
command: |
python3 -m venv venv
- run:
name: Install dependencies
command: |
# python3 -m venv venv
# virtualenv ./venv
. venv/bin/activate
which python
python --version
pip install -r requirements.txt
pip install -r requirements-tests.txt
- run:
name: Run tests
command: |
. venv/bin/activate
# flake8 --exclude=venv* --statistics
coverage erase
coverage run --source=logparser -m pytest tests -s -vv -l --disable-warnings
coverage report
coverage html
coverage xml
coveralls
ls -la
- store_artifacts:
path: htmlcov
- store_artifacts:
path: coverage.xml
- codecov/upload:
file: coverage.xml

py27:
<<: *test-template
docker:
- image: circleci/python:2.7

py35:
<<: *test-template
docker:
- image: circleci/python:3.5

py36:
<<: *test-template
docker:
- image: circleci/python:3.6

workflows:
test:
jobs:
- py27:
is-py27: true
- py35
- py36
- py37
26 changes: 26 additions & 0 deletions .codecov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
codecov:
notify:
require_ci_to_pass: yes

coverage:
precision: 2
round: down
range: "70...100"

status:
project: yes
patch: yes
changes: no

parsers:
gcov:
branch_detection:
conditional: yes
loop: yes
method: no
macro: no

comment:
layout: "header, reach, diff, flags, files"
behavior: default
require_changes: no
2 changes: 2 additions & 0 deletions .coveragerc
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[run]
include = logparser/*
Loading

0 comments on commit 02a18b4

Please sign in to comment.