-
Notifications
You must be signed in to change notification settings - Fork 116
/
.travis.yml
139 lines (125 loc) 路 5.5 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
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
language: python
python:
# We don't actually use the Travis Python, but this keeps it organized.
#- "2.7" # not tested anymore starting from 0.9.19
- "3.8"
os: linux
stages:
- name: test_fast
if: branch = master OR branch = develop
- name: test_slow
if: branch = master OR branch = develop
# we dont test on other branches
- name: lint
if: branch = master OR branch = develop
# we dont lint on other branches
- name: deploy
if: branch = master
jobs:
include:
- stage: test_fast
name: Test and Coverage
install:
# Install Micromamba
# We do this conditionally because it saves us some downloading if the
# version is the same.
# For now use http instead of https according to this comment:
# https://github.com/mamba-org/mamba/issues/1675#issuecomment-1127160021
- wget -qO- https://micro.mamba.pm/api/micromamba/linux-64/0.25.1 | tar -xvj bin/micromamba
- ./bin/micromamba shell init -s bash -p ~/micromamba
- source ~/.bashrc
- micromamba activate base
# Useful for debugging any issues with conda/mamba
- micromamba info
- micromamba config list
# Update python version in environment
- sed -i -E 's/(python=)(.*)/\1'$TRAVIS_PYTHON_VERSION'/' ./environment.yml
# Create conda environment
- micromamba install xtensor -c conda-forge -y
# move requirements.txt to the /tmp folder, required so that .environment.yml finds it
- pwd
- cp requirements.txt /tmp/requirements.txt
# Create the environment:
- micromamba create -f ./environment.yml -y
# Activate and install test-only dependencies
- micromamba activate radis-env
- micromamba list
- pip install pytest-cov
- pip install -e . -v
script:
# Your test script goes here
- echo ">>> Run tests"
# use XVFB to have headless display port, and still run the Matplotlib tests.
- xvfb-run -a pytest -m "fast and not needs_db_CDSD_HITEMP_PCN and not needs_db_CDSD_HITEMP and not needs_db_CDSD_HITEMP_PC" --cov=./ --durations=10
# --durations=N to print the slowest N tests
# lookup 'addopts' in setup.cfg>[tools:pytest] for default tests
services:
- xvfb
before_script:
- export MPLBACKEND=Agg
- stage: test_slow
name: Test and Coverage (slow)
install:
# Install Micromamba
# We do this conditionally because it saves us some downloading if the
# version is the same.
# For now use http instead of https according to this comment:
# https://github.com/mamba-org/mamba/issues/1675#issuecomment-1127160021
- wget -qO- https://micro.mamba.pm/api/micromamba/linux-64/0.25.1 | tar -xvj bin/micromamba
- ./bin/micromamba shell init -s bash -p ~/micromamba
- source ~/.bashrc
- micromamba activate base
# Update python version in environment
- sed -i -E 's/(python=)(.*)/\1'$TRAVIS_PYTHON_VERSION'/' ./environment.yml
# Create conda environment
- micromamba install xtensor -c conda-forge -y
# move requirements.txt to the /tmp folder, required so that .environment.yml finds it
- pwd
- cp requirements.txt /tmp/requirements.txt
# Create the environment:
- micromamba create -f ./environment.yml -y
# Activate and install test-only dependencies
- micromamba activate radis-env
- micromamba list
- pip install pytest-cov
- pip install -e . -v
script:
# Your test script goes here
- echo ">>> Run tests"
# use XVFB to have headless display port, and still run the Matplotlib tests.
- xvfb-run -a pytest --cov=./ --durations=10 #run all tests but that's ok because the redondant tests are fast!
# --durations=N to print the slowest N tests
# lookup 'addopts' in setup.cfg>[tools:pytest] for default tests
services:
- xvfb
after_success:
# codecoverage
- pip install codecov
- codecov
before_script:
- export MPLBACKEND=Agg
- stage: lint
name: Code Quality Checks
install:
- pip install pre-commit
- pre-commit install
script:
- pre-commit run --all-files
after_failure: #better for checking the origin of a bug
- cat /home/travis/.cache/pre-commit/pre-commit.log
- stage: deploy
name: Deploy to PyPI
install:
- sudo apt-get update
script:
- echo "Deploying to PyPI"
before_deploy:
- sudo apt-get install pandoc
- pandoc README.rst -o README.md
deploy:
provider: pypi
user: "__token__"
password:
secure: dxZOpuKL1ezk3MM5FgY89zJYNL484x0jUZ+c3IB5q2GjpWl6qmCogoWG37iGZIcmldeIdVzga3pj5CC32eht4B0hJQX5QLVjCq9wwpfLs7Tkj4ODiAzvOchSLhfBOSLOIX33iW/+wxDjZ3fG61TzPI1z3ksdNh7+imdVYiV+G4FmOcxJKjFEgGm7CAwfbxso47ab9jbgm6FHbCC7HfpSiSrMpyIDSorJFk5XR11+Hoe6JjbKr11eeWuoO8EXKvSQeeJpsu0minqFyAy8nf9af/aU3NJU1LOlFM1DuoYlpQKwnbop5lBodU28zt4Asa1h8lp8Zu+wZSIaZSOeEoC6U/H/5zAE03W8SytWyWgNEtwuYLSiWacbOzeZOclVRoNu4P6Fz9hFdZuSANQlSQN7cBYFJiA8cbJDU4nb3srFoKlBLxCH9ZC3/K7rnZpjPmy7A35plNf+1dAEpB6adiWwsGy/VwCywHyJsBq7N3z6lN9wZ2SUPekl4y/sLobYPqg8y48u4bMqfd05Ub1QDUB3MSNALMa+OcczJvxNHZj+Bk4ooai/t/GOMOWNyy78VES7S/J77cWUheq+mW80ywCS8gcyF6ARR4EJxJGwp4q2RHwGdVvxbzc/uaKgi6I1bmLRw4cjJvOXx5ulLdANUftfMg4ATW/VAFqYLrdS/LpGX5A=
skip_existing: true
distributions: "sdist bdist_wheel"