forked from JohannesBuchner/BXA
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
72 lines (59 loc) · 2.15 KB
/
.travis.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
sudo: required
language: python
os:
- linux
#- osx
python:
- "2.7"
- "3.9"
env:
- TOOL=xspec ASTROPY_VERSION="astropy==2.0"
- TOOL=xspec ASTROPY_VERSION=astropy
- TOOL=sherpa ASTROPY_VERSION="astropy==2.0"
- TOOL=sherpa ASTROPY_VERSION=astropy
services:
- docker
#cache:
# timeout: 3600
# directories:
# - $HOME/docker
# - $HOME/Downloads
#before_cache:
# # Save tagged docker images
# - mkdir -p $HOME/docker $HOME/Downloads
# - chmod 777 $HOME/docker $HOME/Downloads
# - chown -R travis:travis $HOME/docker $HOME/Downloads
# - >
# docker images -a --filter='dangling=false' --format '{{.Repository}}:{{.Tag}} {{.ID}}'
# | xargs -n 2 -t sh -c 'test -e $HOME/docker/$1.tar.gz || docker save $0 | gzip -2 > $HOME/docker/$1.tar.gz'
before_install:
# Load cached docker images
- >
if [[ -d $HOME/docker ]]; then
for i in $HOME/docker/*.tar.gz; do
echo "unpacking $i docker image";
< $i gunzip | docker load || true
done
fi
install:
- pip install requests pymultinest ${ASTROPY_VERSION}
#- if [[ "$TOOL" == "sherpa" ]] && [[ "$TRAVIS_PYTHON_VERSION" == 2.7 ]]; then docker pull johannesbuchner/bxa_absorbed; fi
#- if [[ "$TOOL" == "xspec" ]] && [[ "$TRAVIS_PYTHON_VERSION" == 2.7 ]]; then docker pull giacomov/xspec-docker; fi
script:
# testing scripts
- pushd docker/testsrc
- 'echo "backend: Agg" > matplotlibrc'
- ls
- rm *.nh
- python ../../fixkeywords.py combined_src.pi combined_bkg.pi combined_src.rmf combined_src.arf
- python ../../gal.py combined_src.pi
- git checkout .
# testing sherpa, but not twice for each python version
- if [[ "$TOOL" == "sherpa" ]] && [[ "$TRAVIS_PYTHON_VERSION" == 2.7 ]]; then
docker run $XDOCKERARGS -v $PWD:/opt/example/ -e FILENAME=combined_src.pi -e ELO=0.5 -e EHI=8 -e NLIVEPOINTS=100 -t johannesbuchner/bxa_absorbed </dev/null;
fi
- popd
# testing xspec
- if [[ "$TOOL" == "xspec" ]] && [[ "$TRAVIS_PYTHON_VERSION" == 2.7 ]] && [[ "ASTROPY_VERSION" == "astropy==2.0" ]]; then
docker run --rm -v $PWD/examples/xspec:/opt/script/ -v $PWD:/opt/BXA giacomov/xspec-docker bash /opt/script/test-docker.sh </dev/null;
fi