forked from materialsproject/pymatgen
-
Notifications
You must be signed in to change notification settings - Fork 0
/
config.yml
69 lines (68 loc) · 3.45 KB
/
config.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
version: 2
jobs:
py3test:
working_directory: ~/pymatgen
docker:
- image: materialsvirtuallab/circle-ci-pmg-py3:0.0.2
environment:
PMG_MAPI_ENDPOINT: https://zola.lbl.gov/rest/v2
parallelism: 4
steps:
- checkout
- restore_cache: # restores saved dependency cache if the Branch key template or requirements.txt files have not changed since the previous run
key: deps1-{{ .Branch }}-{{ checksum "requirements.txt" }}-{{ checksum "requirements-optional.txt" }}
- run:
command: |
export PATH=$HOME/miniconda3/bin:$PATH
if [ ! -d "/root/miniconda3/envs/test_env" ]; then conda create --quiet --yes --name test_env python=3.6; fi
source activate test_env
conda install --quiet --yes numpy scipy matplotlib sympy cython
conda install --quiet --yes -c openbabel openbabel
conda install --quiet --yes -c clinicalgraphics vtk
conda install --quiet --yes cmake
conda uninstall --yes pandas
# conda update --quiet --all
mkdir coverage_reports
pip install --upgrade pip
pip install --quiet --ignore-installed -r requirements.txt -r requirements-optional.txt
export CFLAGS=$CFLAGS" -std=gnu++11"
pip install BoltzTraP2
export CFLAGS=${CFLAGS%% -std=gnu++11}
rm -r coverage_reports
- save_cache: # special step to save dependency cache
key: deps1-{{ .Branch }}-{{ checksum "requirements.txt" }}-{{ checksum "requirements-optional.txt" }}
paths:
- "/root/miniconda3/envs/test_env"
- run:
command: |
# Add executables and path.
for EXEPATH in `pwd`/cmd_line/*/Linux_64bit; do export PATH=$PATH:$EXEPATH; done
export PATH=$HOME/miniconda3/bin:$PATH
export GULP_LIB=`pwd`/cmd_line/gulp/Libraries
export MPLBACKEND=Agg
export LC_ALL=en_US.UTF-8
export LANG=en_US.UTF-8
# Only do matproj and other ext API tests once every five random runs or so.
# The parallelism is 4. If 1/20 we have to run, that measn the probability of a matproj test running is 1-(1-0.05)**4 = 0.18.
if [ "$(( RANDOM % 20 ))" -ne "0" ]; then export NOSE_EXCLUDE_TESTS="pymatgen.ext.tests.test_matproj.MPResterTest;pymatgen.analysis.tests.test_pourbaix_diagram.PourbaixDiagramTest;pymatgen.tests.test_init.SettingsTestCase"; fi
export NOSE_EXCLUDE_TESTS="pymatgen.ext.tests.test_matproj.MPResterTest;pymatgen.analysis.tests.test_pourbaix_diagram.PourbaixDiagramTest;pymatgen.tests.test_init.SettingsTestCase"
echo "NOSE_EXCLUDE_TESTS=$NOSE_EXCLUDE_TESTS"
source activate test_env
pip install --quiet -e .
nosetests --config=nose.cfg --processes=4 --process-timeout=600 --cover-html --cover-html-dir=coverage_reports --with-timer --timer-top-n 30
# Command line tests
pmg structure --convert --filenames test_files/Li2O.cif POSCAR.pmg
pmg structure --convert --filenames POSCAR.pmg pmg.cif
pmg analyze -d test_files
if [ "$CI_PULL_REQUEST" == "" ]; then coveralls; fi
no_output_timeout: 3600
- store_artifacts:
path: coverage_reports/
destination: tr1
- store_test_results:
path: coverage_reports/
workflows:
version: 2
build_and_test:
jobs:
- py3test