|
1 | 1 | version: 2.1
|
2 | 2 |
|
3 |
| -commands: |
4 |
| - install-packaged-autonormalize: |
5 |
| - description: "install autonormalize from source distribution" |
6 |
| - steps: |
7 |
| - - run : | |
8 |
| - source test_env/bin/activate |
9 |
| - python setup.py sdist |
10 |
| - AUTONORMALIZE_VERSION=$(python setup.py --version) |
11 |
| - tar -zxvf "dist/autonormalize-${AUTONORMALIZE_VERSION}.tar.gz" |
12 |
| - pip install -e "autonormalize-${AUTONORMALIZE_VERSION}/" |
13 |
| - pip install -r "autonormalize-${AUTONORMALIZE_VERSION}/test-requirements.txt" |
14 |
| - run-packaged-tests: |
15 |
| - description: "run unit tests on packaged testing files" |
16 |
| - steps: |
17 |
| - - run: | |
18 |
| - source test_env/bin/activate |
19 |
| - cd "autonormalize-$(python setup.py --version)/" |
20 |
| - pytest |
21 |
| -
|
22 |
| -jobs: |
23 |
| - "python-27": |
24 |
| - working_directory: ~/auto-norm |
| 3 | +executors: |
| 4 | + python: |
| 5 | + parameters: |
| 6 | + image_tag: |
| 7 | + type: string |
| 8 | + default: python:3.7 |
25 | 9 | docker:
|
26 |
| - - image: circleci/python:2.7 |
27 |
| - steps: |
28 |
| - - checkout |
29 |
| - - run: virtualenv test_env && virtualenv dev_env |
30 |
| - - install-packaged-autonormalize |
31 |
| - - run: source dev_env/bin/activate && make installdeps |
32 |
| - - run: source dev_env/bin/activate && make lint |
33 |
| - - run-packaged-tests |
| 10 | + - image: circleci/<< parameters.image_tag >> |
34 | 11 |
|
35 |
| - "python-35": |
36 |
| - working_directory: ~/auto-norm |
37 |
| - docker: |
38 |
| - - image: circleci/python:3.5 |
| 12 | +commands: |
| 13 | + installation: |
39 | 14 | steps:
|
40 | 15 | - checkout
|
41 |
| - - run: virtualenv test_env && virtualenv dev_env |
42 |
| - - install-packaged-autonormalize |
43 |
| - - run: source dev_env/bin/activate && make installdeps |
44 |
| - - run: source dev_env/bin/activate && make lint |
45 |
| - - run-packaged-tests |
| 16 | + - run: |
| 17 | + name: Installation |
| 18 | + command: | |
| 19 | + python setup.py sdist |
| 20 | + PACKAGE=$(python setup.py --fullname) |
| 21 | + tar -zxvf dist/${PACKAGE}.tar.gz |
| 22 | + mv ${PACKAGE} package |
| 23 | + virtualenv python -q |
| 24 | + source python/bin/activate |
| 25 | + pip install -e package --progress-bar off |
| 26 | + pip install -r package/test-requirements.txt --progress-bar off |
46 | 27 |
|
47 |
| - "python-36": |
48 |
| - working_directory: ~/auto-norm |
49 |
| - docker: |
50 |
| - - image: circleci/python:3.6 |
| 28 | +jobs: |
| 29 | + Lint Tests: |
| 30 | + parameters: |
| 31 | + image_tag: |
| 32 | + type: string |
| 33 | + default: python:3.7 |
| 34 | + executor: |
| 35 | + name: python |
| 36 | + image_tag: << parameters.image_tag >> |
51 | 37 | steps:
|
52 |
| - - checkout |
53 |
| - - run: virtualenv test_env && virtualenv dev_env |
54 |
| - - install-packaged-autonormalize |
55 |
| - - run: source dev_env/bin/activate && make installdeps |
56 |
| - - run: source dev_env/bin/activate && make lint |
57 |
| - - run-packaged-tests |
| 38 | + - installation |
| 39 | + - run: |
| 40 | + name: Lint Tests |
| 41 | + command: | |
| 42 | + source python/bin/activate |
| 43 | + make -C package lint --makefile ../Makefile |
58 | 44 |
|
59 |
| - "python-37": |
60 |
| - working_directory: ~/auto-norm |
61 |
| - docker: |
62 |
| - - image: circleci/python:3.7 |
| 45 | + Unit Tests: |
| 46 | + parameters: |
| 47 | + image_tag: |
| 48 | + type: string |
| 49 | + default: python:3.7 |
| 50 | + codecov: |
| 51 | + type: boolean |
| 52 | + default: false |
| 53 | + executor: |
| 54 | + name: python |
| 55 | + image_tag: << parameters.image_tag >> |
63 | 56 | steps:
|
64 |
| - - checkout |
65 |
| - - run: virtualenv test_env && virtualenv dev_env |
66 |
| - - install-packaged-autonormalize |
67 |
| - - run: source dev_env/bin/activate && make installdeps |
68 |
| - - run: source dev_env/bin/activate && make lint |
69 |
| - - run-packaged-tests |
| 57 | + - installation |
| 58 | + - run: |
| 59 | + name: Unit Tests |
| 60 | + command: | |
| 61 | + source python/bin/activate |
| 62 | + pytest autonormalize/ |
| 63 | + - when: |
| 64 | + condition: << parameters.codecov >> |
| 65 | + steps: |
| 66 | + - run: |
| 67 | + name: Code Coverage |
| 68 | + command: | |
| 69 | + source python/bin/activate |
| 70 | + cd package |
| 71 | + codecov |
70 | 72 |
|
| 73 | + Entry Point Test: |
| 74 | + parameters: |
| 75 | + image_tag: |
| 76 | + type: string |
| 77 | + default: python:3.7 |
| 78 | + executor: |
| 79 | + name: python |
| 80 | + image_tag: << parameters.image_tag >> |
| 81 | + steps: |
| 82 | + - installation |
| 83 | + - run: |
| 84 | + name: Entry Point Test |
| 85 | + command: | |
| 86 | + source python/bin/activate |
| 87 | + make -C package entry-point-test --makefile ../Makefile |
71 | 88 |
|
72 | 89 | workflows:
|
73 | 90 | version: 2
|
74 |
| - test_all_python_versions: |
| 91 | + Integration Tests: |
75 | 92 | jobs:
|
76 |
| - - "python-27" |
77 |
| - - "python-35" |
78 |
| - - "python-36" |
79 |
| - - "python-37" |
| 93 | + - Lint Tests: |
| 94 | + name: Py35 - Lint Tests |
| 95 | + image_tag: python:3.5 |
| 96 | + - Lint Tests: |
| 97 | + name: Py36 - Lint Tests |
| 98 | + image_tag: python:3.6 |
| 99 | + - Lint Tests: |
| 100 | + name: Py37 - Lint Tests |
| 101 | + image_tag: python:3.7 |
| 102 | + - Unit Tests: |
| 103 | + name: Py35 - Unit Tests |
| 104 | + image_tag: python:3.5 |
| 105 | + - Unit Tests: |
| 106 | + name: Py36 - Unit Tests |
| 107 | + image_tag: python:3.6 |
| 108 | + - Unit Tests: |
| 109 | + name: Py37 - Unit Tests |
| 110 | + image_tag: python:3.7 |
| 111 | + codecov: true |
| 112 | + - Entry Point Test: |
| 113 | + name: Py35 - Entry Point Test |
| 114 | + image_tag: python:3.5 |
| 115 | + - Entry Point Test: |
| 116 | + name: Py36 - Entry Point Test |
| 117 | + image_tag: python:3.6 |
| 118 | + - Entry Point Test: |
| 119 | + name: Py37 - Entry Point Test |
| 120 | + image_tag: python:3.7 |
0 commit comments