-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path.travis.yml
61 lines (56 loc) · 2.17 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
# spudtr requires a current GIT_TOKEN on TravisCI kutaslab/spudtr
env:
- PACKAGE_NAME: spudtr # for the conda_upload.sh deploy script
language: minimal
before_install:
# b.c conda build GIT_BUILD_STR works (or not) in mysterious ways ...
# pfx g means ordinary commit, r means github tagged vM.N.P release
- if [[ $TRAVIS_TAG =~ v[0-9]+\.[0-9]+\.[0-9]+ ]]; then pfx=r; else pfx=g; fi
- export GIT_ABBREV_COMMIT=${pfx}$(git log --full-history --abbrev-commit --oneline -n 1 | awk '{print $1}')
- echo "git commit $GIT_ABBREV_COMMIT"
- wget https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -O miniconda.sh
- bash miniconda.sh -b -p $HOME/miniconda
- source $HOME/miniconda/etc/profile.d/conda.sh && conda activate
- hash -r
- conda config --set always_yes yes --set changeps1 no
- conda info -a
install:
- conda install -q conda-build conda-verify
- conda build conda -c defaults -c conda-forge
- conda create --name spudtr_env spudtr -c local -c defaults -c conda-forge
- conda activate spudtr_env # so tests run in env as installed by conda
- conda install black pytest-cov
- conda list
- lscpu
- python -c 'import numpy; numpy.show_config()'
script:
- black --check --verbose .
- pytest --cov=spudtr
after_success:
- pip install codecov && codecov
deploy:
# homegrown replacement for pages provider
- provider: script
skip_cleanup: true
script: bash ./ci/ghpages_upload.sh
on:
branch: master # for normal operation
# all_branches: true # for testing deploy only
# conda_upload.sh switches anaconda upload on $TRAVIS_BRANCH
# master M.N.P or M.N.P.devX -> /pre-release
# tagged vM.N.P -> /main
# else dry run, no conda upload
- provider: script
skip_cleanup: true
script: bash ./ci/conda_upload.sh
on:
all_branches: true
- provider: pypi
skip_cleanup: true
user: "__token__"
password: $PYPI_TOKEN
on:
# only upload tagged vM.N.P github releases to PyPI
branch: master
tags: true
condition: $TRAVIS_TAG =~ ^v[0-9]+\.[0-9]+\.[0-9]+$