-
Notifications
You must be signed in to change notification settings - Fork 987
/
.travis.yml
87 lines (77 loc) · 2.83 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
dist: bionic
language: rust
# This line would cache cargo-audit once installed,
# but instead will fail from the 10 minute timeout after
# printing the line "creating directory /home/travis/.cache/sccache"
#cache: cargo
rust:
- stable
- beta
# Select pre-installed services
addons:
postgresql: "10"
apt:
packages:
- postgresql-10
- postgresql-client-10
services:
- postgresql
- docker
before_install:
# Install Node.js 11.x
- nvm install 11 && nvm use 11
# Install IPFS
- wget "https://dist.ipfs.io/go-ipfs/v0.10.0/go-ipfs_v0.10.0_linux-amd64.tar.gz" -O /tmp/ipfs.tar.gz
- pushd . && cd $HOME/bin && tar -xzvf /tmp/ipfs.tar.gz && popd
- export PATH="$HOME/bin/go-ipfs:$PATH"
- ipfs init
matrix:
fast_finish: true
include:
# Some env var is always necessary to differentiate included builds
# Check coding style
- env: CHECK_FORMATTING=true
rust: stable
script:
- rustup component add rustfmt
- cargo fmt --all -- --check
# Make sure release builds compile
- env: CHECK_RELEASE=true
rust: stable
script:
- cargo check --release
# Check for warnings
- env: RUSTFLAGS="-D warnings"
rust: stable
script:
- cargo check --tests
# Build tagged commits in release mode
- env: RELEASE=true
if: tag IS present
script:
- cargo build -p graph-node --release
- mv target/release/graph-node target/release/graph-node-$TRAVIS_OS_NAME
env:
global:
- PGPORT=5432
- THEGRAPH_STORE_POSTGRES_DIESEL_URL=postgresql://travis:travis@localhost:5432/graph_node_test
# Added because https://nodejs.org/dist/ had issues
- NVM_NODEJS_ORG_MIRROR=https://cnpmjs.org/mirrors/node/
# Test pipeline
before_script:
- psql -c "ALTER USER travis WITH PASSWORD 'travis';"
- psql -c 'create database graph_node_test;' -U travis
script:
# Run tests
- ipfs daemon &> /dev/null &
- RUST_BACKTRACE=1 cargo test --verbose --all -- --nocapture
- killall ipfs
deploy:
provider: releases
api_key:
secure: ygpZedRG+/Qg/lPhifyNQ+4rExjZ4nGyJjB4DYT1fuePMyKXfiCPGicaWRGR3ZnZGNRjdKaIkF97vBsZ0aHwW+AykwOxlXrkAFvCKA0Tb82vaYqCLrBs/Y5AEhuCWLFDz5cXDPMkptf+uLX/s3JCF0Mxo5EBN2JfBQ8vS6ScKEwqn2TiLLBQKTQ4658TFM4H5KiXktpyVVdlRvpoS3pRIPMqNU/QpGPQigaiKyYD5+azCrAXeaKT9bBS1njVbxI69Go4nraWZn7wIhZCrwJ+MxGNTOxwasypsWm/u1umhRVLM1rL2i7RRqkIvzwn22YMaU7FZKCx8huXcj0cB8NtHZSw7GhJDDDv3e7puZxl3m/c/7ks76UF95syLzoM/9FWEFew8Ti+5MApzKQj5YWHOCIEzBWPeqAcA8Y+Az7w2h1ZgNbjDgSvjGAFSpE8m+SM0A2TOOZ1g/t/yfbEl8CWO6Y8v2x1EONkp7X0CqJgASMp+h8kzKCbuYyRnghlToY+5wYuh4M9Qg9UeJCt9dOblRBVJwW5CFr62kgE/gso8F9tXXHkRTv3hfk5madZR1Vn5A7KadEO8epfV4IQNsd+VHfoxoJSprx5f77Q2bLMBD1GT/qMqECgSznoTkU5ajkKJRqUw4AwLTohrYir76j61eQfxOhXExY/EM8xvlxpd1w=
file: target/release/graph-node-$TRAVIS_OS_NAME
repo: graphprotocol/graph-node
on:
tags: true
skip_cleanup: true