|
1 | 1 | # Python CircleCI 2.0 configuration file
|
2 | 2 | # vi: et:ts=2:sw=2
|
3 |
| -# |
4 |
| -# Check https://circleci.com/docs/2.0/language-python/ for more details |
5 |
| -# |
6 |
| -version: 2 |
| 3 | + |
| 4 | +version: 2.0 |
| 5 | + |
7 | 6 | jobs:
|
8 |
| - build: |
| 7 | + python_27: |
9 | 8 | docker:
|
10 |
| - - image: circleci/python:3-stretch |
| 9 | + - image: circleci/python:2.7.17 |
| 10 | + environment: &env |
| 11 | + VERSION: 2.16.5 |
| 12 | + C_INCLUDE_PATH: /usr/local/include:/usr/include |
| 13 | + LD_LIBRARY_PATH: /usr/local/lib:/usr/lib |
11 | 14 | working_directory: ~/python-mbedtls
|
12 | 15 | steps:
|
13 | 16 | - checkout
|
14 |
| - |
15 |
| - - run: |
16 |
| - name: Downgrade openssl for Python 3.4 |
| 17 | + - run: &deps |
| 18 | + name: Install dependencies |
17 | 19 | command: |
|
18 |
| - sudo apt-get update |
19 |
| - sudo apt-get install libssl1.0-dev |
20 |
| -
|
| 20 | + command -v python |
| 21 | + sudo python -m pip install tox |
| 22 | + - run: &mbedtls |
| 23 | + name: Install mbedtls |
| 24 | + command: | |
| 25 | + sudo ./scripts/download-mbedtls.sh $VERSION /usr/local/src |
| 26 | + sudo ./scripts/install-mbedtls.sh /usr/local/src |
21 | 27 | - run:
|
22 |
| - name: Install pyenv |
| 28 | + name: Run tests |
23 | 29 | command: |
|
24 |
| - git clone https://github.com/pyenv/pyenv.git $HOME/python-mbedtls/.pyenv |
25 |
| - cat << 'EOF' >> $BASH_ENV |
26 |
| - export PYENV_ROOT="$HOME/python-mbedtls/.pyenv" |
27 |
| - export PATH="$PYENV_ROOT/bin:$PATH" |
28 |
| - EOF |
29 |
| -
|
30 |
| - - restore_cache: |
31 |
| - key: py27-2.7.16-v0-{{ arch }} |
32 |
| - - restore_cache: |
33 |
| - key: py34-3.4.10-v0-{{ arch }} |
34 |
| - - restore_cache: |
35 |
| - key: py35-3.5.9-v0-{{ arch }} |
36 |
| - - restore_cache: |
37 |
| - key: py36-3.6.10-v0-{{ arch }} |
38 |
| - - restore_cache: |
39 |
| - key: py37-3.7.6-v0-{{ arch }} |
40 |
| - - restore_cache: |
41 |
| - key: py38-3.8.1-v0-{{ arch }} |
| 30 | + tox -e py27 |
| 31 | + - run: &keep_logs |
| 32 | + name: Save logs |
| 33 | + when: on_fail |
| 34 | + command: | |
| 35 | + mkdir -p out/log |
| 36 | + cp .tox/*/log/py*.log out/log || true |
| 37 | + - store_artifacts: &artifacts |
| 38 | + path: out |
| 39 | + destination: artifacts |
42 | 40 |
|
| 41 | + python_34: |
| 42 | + docker: |
| 43 | + - image: circleci/python:3.4.10 |
| 44 | + environment: *env |
| 45 | + working_directory: ~/python-mbedtls |
| 46 | + steps: |
| 47 | + - checkout |
| 48 | + - run: *deps |
| 49 | + - run: *mbedtls |
43 | 50 | - run:
|
44 |
| - name: Install Python versions |
| 51 | + name: Run tests |
45 | 52 | command: |
|
46 |
| - eval "$(pyenv init -)" |
47 |
| - test -d ".pyenv/versions/2.7.16" || pyenv install 2.7.16 |
48 |
| - test -d ".pyenv/versions/3.4.10" || pyenv install 3.4.10 |
49 |
| - test -d ".pyenv/versions/3.5.9" || pyenv install 3.5.9 |
50 |
| - test -d ".pyenv/versions/3.6.10" || pyenv install 3.6.10 |
51 |
| - test -d ".pyenv/versions/3.7.6" || pyenv install 3.7.6 |
52 |
| - test -d ".pyenv/versions/3.8.1" || pyenv install 3.8.1 |
53 |
| -
|
54 |
| - - save_cache: |
55 |
| - key: py27-2.7.16-v0-{{ arch }} |
56 |
| - paths: |
57 |
| - - .pyenv/versions/2.7.16 |
58 |
| - - save_cache: |
59 |
| - key: py34-3.4.10-v0-{{ arch }} |
60 |
| - paths: |
61 |
| - - .pyenv/versions/3.4.10 |
62 |
| - - save_cache: |
63 |
| - key: py35-3.5.9-v0-{{ arch }} |
64 |
| - paths: |
65 |
| - - .pyenv/versions/3.5.9 |
66 |
| - - save_cache: |
67 |
| - key: py36-3.6.10-v0-{{ arch }} |
68 |
| - paths: |
69 |
| - - .pyenv/versions/3.6.10 |
70 |
| - - save_cache: |
71 |
| - key: py37-3.7.6-v0-{{ arch }} |
72 |
| - paths: |
73 |
| - - .pyenv/versions/3.7.6 |
74 |
| - - save_cache: |
75 |
| - key: py38-3.8.1-v0-{{ arch }} |
76 |
| - paths: |
77 |
| - - .pyenv/versions/3.8.1 |
| 53 | + tox -e py34 |
| 54 | + - run: *keep_logs |
| 55 | + - store_artifacts: *artifacts |
78 | 56 |
|
| 57 | + python_35: |
| 58 | + docker: |
| 59 | + - image: circleci/python:3.5.9 |
| 60 | + environment: *env |
| 61 | + working_directory: ~/python-mbedtls |
| 62 | + steps: |
| 63 | + - checkout |
| 64 | + - run: *deps |
| 65 | + - run: *mbedtls |
79 | 66 | - run:
|
80 |
| - name: Install mbedtls |
| 67 | + name: Run tests |
81 | 68 | command: |
|
82 |
| - VERSION=2.16.5 |
83 |
| - DESTDIR=$HOME/lib/$VERSION |
84 |
| - sudo apt-get install cmake |
85 |
| - sudo ./scripts/download-mbedtls.sh $VERSION $DESTDIR/src |
86 |
| - sudo ./scripts/install-mbedtls.sh $DESTDIR/src $DESTDIR |
87 |
| - cat << EOF >> $BASH_ENV |
88 |
| - export VERSION=$VERSION |
89 |
| - export DESTDIR=$DESTDIR |
90 |
| - export LD_LIBRARY_PATH=$DESTDIR/lib |
91 |
| - export C_INCLUDE_PATH=$DESTDIR/include |
92 |
| - export TOX_PARALLEL_NO_SPINNER=1 |
93 |
| - EOF |
| 69 | + tox -e py35 |
| 70 | + - run: *keep_logs |
| 71 | + - store_artifacts: *artifacts |
94 | 72 |
|
| 73 | + python_36: |
| 74 | + docker: |
| 75 | + - image: circleci/python:3.6.10 |
| 76 | + environment: *env |
| 77 | + working_directory: ~/python-mbedtls |
| 78 | + steps: |
| 79 | + - checkout |
| 80 | + - run: *deps |
| 81 | + - run: *mbedtls |
95 | 82 | - run:
|
96 |
| - name: Create environment |
| 83 | + name: Run tests |
97 | 84 | command: |
|
98 |
| - python -m venv venv |
99 |
| - . venv/bin/activate |
100 |
| - pip install -r requirements/circleci.txt |
| 85 | + tox -e py36 |
| 86 | + - run: *keep_logs |
| 87 | + - store_artifacts: *artifacts |
101 | 88 |
|
| 89 | + python_37: |
| 90 | + docker: |
| 91 | + - image: circleci/python:3.7.6 |
| 92 | + environment: *env |
| 93 | + working_directory: ~/python-mbedtls |
| 94 | + steps: |
| 95 | + - checkout |
| 96 | + - run: *deps |
| 97 | + - run: *mbedtls |
102 | 98 | - run:
|
103 | 99 | name: Run tests
|
104 | 100 | command: |
|
105 |
| - eval "$(pyenv init -)" |
106 |
| - pyenv shell 2.7.16 3.4.10 3.5.9 3.6.10 3.7.6 3.8.1 |
107 |
| - . venv/bin/activate |
108 |
| - tox --parallel auto -e py27,py34,py35,py36,py37-coveralls,py38 |
| 101 | + tox -e py37-coveralls |
| 102 | + - run: |
| 103 | + name: Run doctest |
| 104 | + command: | |
| 105 | + sudo python -m pip install tox-run-command |
109 | 106 | tox -e py37 --run-command "{envpython} -m doctest {toxinidir}/README.rst"
|
110 |
| -
|
111 | 107 | - run:
|
112 | 108 | name: Build API documentation
|
113 | 109 | command: |
|
114 | 110 | eval "$(pyenv init -)"
|
115 |
| - pyenv shell 3.7.6 |
116 |
| - . venv/bin/activate |
117 | 111 | tox -e py37-docs
|
118 |
| -
|
119 | 112 | - run:
|
120 | 113 | name: Save docs
|
121 | 114 | when: on_success
|
122 | 115 | command: |
|
123 | 116 | mkdir -p out/
|
124 | 117 | cp -R .tox/docs_out out/docs
|
| 118 | + - run: *keep_logs |
| 119 | + - store_artifacts: *artifacts |
| 120 | + |
| 121 | + python_38: |
| 122 | + docker: |
| 123 | + - image: circleci/python:3.8.2 |
| 124 | + environment: *env |
| 125 | + working_directory: ~/python-mbedtls |
| 126 | + steps: |
| 127 | + - checkout |
| 128 | + - run: *deps |
| 129 | + - run: *mbedtls |
| 130 | + - run: |
| 131 | + name: Run tests |
| 132 | + command: | |
| 133 | + tox -e py38 |
| 134 | + - run: *keep_logs |
| 135 | + - store_artifacts: *artifacts |
125 | 136 |
|
| 137 | + python_39: |
| 138 | + docker: |
| 139 | + - image: circleci/python:3.9-rc |
| 140 | + environment: *env |
| 141 | + working_directory: ~/python-mbedtls |
| 142 | + steps: |
| 143 | + - checkout |
| 144 | + - run: *deps |
| 145 | + - run: *mbedtls |
126 | 146 | - run:
|
127 |
| - name: Save logs |
128 |
| - when: on_fail |
| 147 | + name: Run tests |
129 | 148 | command: |
|
130 |
| - mkdir -p out/log |
131 |
| - cp .tox/*/log/py*.log out/log || true |
| 149 | + tox -e py39 |
| 150 | + - run: *keep_logs |
| 151 | + - store_artifacts: *artifacts |
132 | 152 |
|
133 |
| - - store_artifacts: |
134 |
| - path: out |
135 |
| - destination: artifacts |
| 153 | +workflows: |
| 154 | + version: 2 |
| 155 | + build: |
| 156 | + jobs: |
| 157 | + - python_39 |
| 158 | + - python_38 |
| 159 | + # - python_37 # ok |
| 160 | + # - python_36 # ok |
| 161 | + # - python_35 # ok |
| 162 | + # - python_34 # ok |
| 163 | + # - python_27 # ok |
0 commit comments