forked from conda/conda
-
Notifications
You must be signed in to change notification settings - Fork 0
/
circle.yml
245 lines (233 loc) · 10.5 KB
/
circle.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
# The Docker images used here are
# - condatest/linux-64-python-3.7 [https://github.com/conda/conda-docker/blob/master/condatest/linux-64-python3.7/Dockerfile]
# - condatest/linux-64-python-3.6 [https://github.com/conda/conda-docker/blob/master/condatest/linux-64-python3.6/Dockerfile]
# - condatest/linux-64-python-2.7 [https://github.com/conda/conda-docker/blob/master/condatest/linux-64-python2.7/Dockerfile]
defaults: &defaults
working_directory: ~/conda
docker:
- image: condatest/linux-64-python-3.7
main_test: &main_test
<<: *defaults
steps:
- checkout
- run:
name: unit tests
command: |
if [[ $(git diff origin/master --name-only | wc -l) == $(git diff origin/master --name-only | grep docs | wc -l) && $(git diff origin/master --name-only | grep docs) ]]; then
echo "Only docs changed detected, skipping tests"
else
echo "local_repodata_ttl: 1800" >> ~/.condarc
eval "$(sudo /opt/conda/bin/python -m conda init --dev bash)"
conda info
# remove the pkg cache. We can't hardlink from here anyway. Having it around causes log problems.
sudo rm -rf /opt/conda/pkgs/*-*-*
py.test $ADD_COV -m "not integration and not installed" -v
fi
- run:
name: integration tests
command: |
if [[ $(git diff origin/master --name-only | wc -l) == $(git diff origin/master --name-only | grep docs | wc -l) && $(git diff origin/master --name-only | grep docs) ]]; then
echo "Only docs changed detected, skipping tests"
else
eval "$(sudo /opt/conda/bin/python -m conda init --dev bash)"
py.test $ADD_COV --cov-append -m "integration and not installed" -v
python -m conda.common.io
fi
- run:
name: upload codecov
command: |
if [[ $(git diff origin/master --name-only | wc -l) == $(git diff origin/master --name-only | grep docs | wc -l) && $(git diff origin/master --name-only | grep docs) ]]; then
echo "No codecov report to upload"
else
/opt/conda/bin/codecov --env PYTHON_VERSION --flags integration --required
echo "No codecov report to upload"
fi
conda_build_test: &conda_build_test
<<: *defaults
environment:
CONDA_BUILD: master
steps:
- checkout
- run:
name: checkout conda-build
# TODO: transfer conda-verify install to Dockerfile
command: |
sudo su root -c "/opt/conda/bin/conda install -yq conda-verify"
cb_branch="${CONDA_BUILD:-master}"
git clone -b $cb_branch https://github.com/conda/conda-build.git ~/conda-build
sudo /opt/conda/bin/pip install --no-deps -U ~/conda-build
git clone https://github.com/conda/conda_build_test_recipe.git ~/conda_build_test_recipe
/opt/conda/bin/conda info
sudo chown -R $(id -nu):$(id -ng) /opt/conda # conda-build tests assume writable base prefix
rm ~/.gitconfig
# circleci image by default has
# $ cat ~/.gitconfig
# [url "ssh://[email protected]"]
# insteadOf = https://github.com
# This messes up conda-build tests
- run:
name: configure and pre-populate cache
# pre-populating the package cache helps avoid race conditions for testing in parallel
command: |
eval "$(sudo /opt/conda/bin/python -m conda init --dev bash)"
echo "safety_checks: disabled" >> ~/.condarc
echo "local_repodata_ttl: 1800" >> ~/.condarc
conda create -n blarg -yq --download-only python=2.7
conda create -n blarg -yq -c https://repo.anaconda.com/pkgs/free --download-only python=3.4
conda create -n blarg -yq --download-only python=3.5
conda create -n blarg -yq --download-only python=3.6
conda create -n blarg -yq --download-only python=3.7
conda create -n blarg -yq --download-only python setuptools cython certifi
conda create -n blarg -yq -c https://repo.anaconda.com/pkgs/free --download-only libpng=1.6.17
- run:
name: conda-build conda
command: |
eval "$(sudo /opt/conda/bin/python -m conda init --dev bash)"
rm -rf ~/conda/conda.egg-info
conda build ~/conda/conda.recipe
- run:
name: conda-build tests [parallel]
environment:
CONDABUILD_SKIP: >
not xattr
and not skeleton_pypi
and not test_expand_globs
and not test_build_expands_wildcards
and not numpy
and not test_intradependencies
and not perl-cpan-Moo
and not cran-nmf
and not test_preferred_env
and not test_name_with_version_specified
and not test_pypi_with_setup_options
and not test_pypi_with_extra_specs
and not test_ensure_valid_spec_on_run_and_test
and not test_get_installed_version
and not test_indirect_numpy_dependency
and not test_only_lua_env
and not test_setuptools_test_requirements
and not alternate_type_wheel
and not rpm-libX11-devel
and not test_resolved_packages_recipe
and not test_overlinking_detection
and not test_python_line_up_with_compiled_lib
# skeleton_pypi skipped because of changes to PyPI API
# expand_globs and build_expands_wildcards fail on circleci because of list ordering discrepancies
# skipping numpy tests so circleci images don't need numpy (and mkl) installed
# test_intradependencies started failing after pkgs/main release it seems
# skipping perl-cpan-Moo because of changes in cpan API
# skipping cran-nmf because nmf was removed/archived in cran
# for test_preferred_env see https://github.com/conda/conda/issues/3912#issuecomment-374820599
# test_name_with_version_specified because of the new PyPI
# test_pypi_with_setup_options because of the new PyPI
# test_pypi_with_extra_specs because of the new PyPI
# test_get_installed_version invalid test when using 'conda init --dev'
# test_indirect_numpy_dependency contains conda-forge
# test_only_lua_env contains conda-forge
# test_setuptools_test_requirements upstream changes that affect 'conda skeleton'
# alternate_type_wheel broken with pip 10
# rpm-libX11-devel returns 404 error
# test_resolved_packages_recipedue to openssl not being pinned
# test_overlinking_detection package doesn't have configure
# test_python_line_up_with_compiled_lib because older CB honors run_exports.yaml and not run_exports.json
command: |
if [[ $(git diff origin/master --name-only | wc -l) == $(git diff origin/master --name-only | grep docs | wc -l) && $(git diff origin/master --name-only | grep docs) ]]; then
echo "Only docs changed detected, skipping tests"
else
eval "$(sudo /opt/conda/bin/python -m conda init --dev bash)"
conda config --add default_channels https://repo.anaconda.com/pkgs/free
conda config --add default_channels https://repo.anaconda.com/pkgs/r
conda config --add default_channels https://repo.anaconda.com/pkgs/main
conda config --set unsatisfiable_hints False
conda info
cd ~/conda-build
py.test --basetemp /tmp/cb -v --durations=20 -n 2 -m "not serial" tests -k "$CONDABUILD_SKIP"
fi
- run:
name: conda-build tests [serial]
environment:
CONDABUILD_SKIP: >
not perl-cpan-Moo
and not cran-nmf
and not skeleton_pypi
and not env_creation_with_short_prefix_does_not_deadlock
and not test_preferred_env
and not test_setuptools_test_requirements
and not rpm-libX11-devel
# skipping perl-cpan-Moo because of changes in cpan API
# skipping cran-nmf because nmf was removed/archived in cran
# skeleton_pypi skipped because of changes to PyPI API
# env_creation_with_short_prefix_does_not_deadlock: error is prefix is too long
# for test_preferred_env see https://github.com/conda/conda/issues/3912#issuecomment-374820599
# test_setuptools_test_requirements upstream changes that affect 'conda skeleton'
# rpm-libX11-devel returns 404 error
command: |
if [[ $(git diff origin/master --name-only | wc -l) == $(git diff origin/master --name-only | grep docs | wc -l) && $(git diff origin/master --name-only | grep docs) ]]; then
echo "Only docs changed detected, skipping tests"
else
eval "$(sudo /opt/conda/bin/python -m conda init --dev bash)"
conda config --add default_channels https://repo.anaconda.com/pkgs/free
conda config --add default_channels https://repo.anaconda.com/pkgs/r
conda config --add default_channels https://repo.anaconda.com/pkgs/main
conda config --set unsatisfiable_hints False
conda info
cd ~/conda-build
py.test --basetemp /tmp/cb -v --durations=20 -n 0 -m "serial" tests -k "$CONDABUILD_SKIP"
/opt/conda/bin/python -m conda.common.io
fi
flake8: &flake8
<<: *defaults
steps:
- checkout
- run: /opt/conda/bin/flake8 --statistics
build_docs: &build_docs
working_directory: ~/conda
docker:
- image: readthedocs/build
steps:
- checkout
- run:
command: |
pip3 install -r utils/requirements-docs.txt
cd docs
make html
jobs:
py37 main tests:
<<: *main_test
docker:
- image: condatest/linux-64-python-3.7
environment:
- CONDA_INSTRUMENTATION_ENABLED: true
py36 main tests:
<<: *main_test
docker:
- image: condatest/linux-64-python-3.6
environment:
- CONDA_INSTRUMENTATION_ENABLED: true
py27 main tests:
<<: *main_test
docker:
- image: condatest/linux-64-python-2.7
environment:
- CONDA_INSTRUMENTATION_ENABLED: true
3.10 conda-build:
<<: *conda_build_test
# mpi4py test in conda-build needs py<3.7
docker:
- image: condatest/linux-64-python-3.6
environment:
- CONDA_BUILD: 3.10.1
- CONDA_INSTRUMENTATION_ENABLED: true
flake8: *flake8
build_docs: *build_docs
version: 2
workflows:
version: 2
conda tests:
jobs:
- py37 main tests
# - py36 main tests
- py27 main tests
- 3.10 conda-build
- flake8
- build_docs