-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy path.travis.yml
43 lines (38 loc) · 1.23 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
language: python
python:
- "3.7"
cache:
pip: true
directories:
- .pytest_cache/
stages:
- name: test
if: (branch = master) OR (type = pull_request AND head_branch = master)
- name: deploy
if: (tag IS present) OR (branch = master) OR (type = pull_request AND head_branch = master)
jobs:
include:
- stage: test
before_script:
- pip install -e .[test]
script:
- pytest
- pylint setup.py torchrl examples
- stage: deploy
before_script:
- pip install -e .[docs]
script:
- pushd docs && make html && popd
- cp _redirects docs/build/html
after_success:
- curl -LO https://github.com/netlify/netlifyctl/releases/download/v0.4.0/netlifyctl-linux-amd64-0.4.0.tar.gz && tar -xzvf netlifyctl-linux-amd64-0.4.0.tar.gz
- echo no | ./netlifyctl deploy -n torchrl -A $NETLIFY_ACCESS_TOKEN -P docs/build/html -m "$TRAVIS_COMMIT_MESSAGE" $([[ -z $TRAVIS_PULL_REQUEST_BRANCH && $TRAVIS_BRANCH = "master" ]] && echo "" || echo "-d")
before_deploy:
- echo "$TRAVIS_TAG" > VERSION
deploy:
provider: pypi
user: $PYPI_USERNAME
password: $PYPI_PASSWORD
skip_cleanup: true
on:
tags: true