-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path.travis.yml
96 lines (84 loc) · 1.93 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
language: python
os: linux
dist: bionic
cache:
- pip
- cargo
stages:
- test
- deploy
env:
global:
- TRAVIS_RUST_VERSION=nightly-2020-02-03
- RUST_BACKTRACE=1
python_test: &python_test
stage: test
before_install:
- source ci/travis/setup_rust.sh
- cd nblast-py
- pip install -r requirements.txt
install:
- maturin develop
script:
- pytest -v
jobs:
include:
# TEST
- stage: test
name: "test rust"
before_install:
- source ci/travis/setup_rust.sh
install:
- cd nblast-rs
- cargo build
script:
- cargo test
- cargo clippy
- cargo fmt -- --check
- stage: test
name: "lint python"
python: 3.8
before_install:
- cd nblast-py
- pip install $(grep '^black' requirements.txt)
- pip install $(grep '^flake8' requirements.txt)
install: true # override default
script:
- flake8 pynblast tests
- black --check pynblast tests
- <<: *python_test
name: "test py36"
python: 3.6
- <<: *python_test
name: "test py37"
python: 3.7
- <<: *python_test
name: "test py38"
python: 3.8
# DEPLOY
- stage: deploy
name: "PyPI (linux)"
if: tag =~ /^py-v\d+.*/
addons:
apt:
sources:
- deadsnakes
packages:
- python3.6
- python3.7
- python3.8
before_install:
- source ci/travis/setup_rust.sh
install:
- cd nblast-py
- pip install $(grep '^maturin' requirements.txt)
script:
- maturin publish -u $PYPI_USERNAME -p $PYPI_PASSWORD -i python3.8 -i python3.7 -i python3.6
- stage: deploy # implied
name: "crates.io"
if: tag =~ /^rs-v\d+.*/
before_install:
- source ci/travis/setup_rust.sh
script:
- cd nblast-rs
- cargo publish --token $CARGO_TOKEN