forked from nervosnetwork/ckb
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
137 lines (127 loc) · 5.27 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
language: rust
rust: 1.36.0
dist: xenial
sudo: true
cache:
directories:
- $HOME/.cargo
timeout: 1024
git:
depth: 2
submodules: false
env:
global:
- RUST_BACKTRACE=full
- CKB_CLI_VERSION=v0.19.0
addons:
apt:
packages:
- libssl-dev
- autoconf
- flex
- bison
- texinfo
- libtool
before_script:
- if [ "$TRAVIS_OS_NAME" = "osx" ]; then ulimit -n 8192; fi
script: make test
before_cache:
- rm -rf $HOME/.cargo/registry
deploy:
provider: releases
api_key: "$GITHUB_TOKEN"
file:
- "releases/ckb_${TRAVIS_TAG}_${REL_PKG}"
- "releases/ckb_${TRAVIS_TAG}_${REL_PKG}.asc"
skip_cleanup: true
prerelease: true
overwrite: true
on:
tags: true
condition: '"$GITHUB_TOKEN" != "" && "$REL_PKG" != ""'
matrix:
include:
# We don't run tests, linters and quck check in fork branch, since they will be covered in PR.
- name: Tests on macOS
if: 'tag IS NOT present AND (type = pull_request OR branch IN (master, staging, trying))'
os: osx
- name: Tests on Linux
if: 'tag IS NOT present AND (type = pull_request OR branch IN (master, staging, trying) OR repo != nervosnetwork/ckb)'
os: linux
- name: PR Integration
if: 'tag IS NOT present AND branch != develop AND branch !~ /^rc\// AND (type = pull_request OR repo != nervosnetwork/ckb)'
os: linux
script: make CKB_TEST_ARGS="--max-time 1200" integration
- name: Linters
if: 'tag IS NOT present AND (type = pull_request OR branch in (master, staging, trying) OR repo != nervosnetwork/ckb)'
env: CACHE_NAME=linters
os: linux
install:
- cargo fmt --version || travis_retry rustup component add rustfmt
- cargo clippy --version || travis_retry rustup component add clippy
script:
- make fmt
- make clippy
- git diff --exit-code Cargo.lock
- name: Quick Check
if: 'tag IS NOT present AND (type = pull_request OR branch in (master, staging, trying) OR repo != nervosnetwork/ckb)'
os: linux
cache: false
addons: { apt: { packages: [] } }
script:
- make check-cargotoml
- make check-whitespaces
- make check-dirty-rpc-doc
- name: Test benchmarks on Linux
env: CACHE_NAME=bench
if: 'tag IS NOT present AND type != pull_request AND (branch IN (master, staging, trying) OR branch =~ /^rc\// OR (branch = develop AND commit_message !~ /^Merge #\d+/))'
os: linux
script: make bench-test
- name: Integration on macOS
if: 'tag IS NOT present AND type != pull_request AND (branch IN (master, staging, trying) OR branch =~ /^rc\// OR (branch = develop AND commit_message !~ /^Merge #\d+/))'
os: osx
script: make integration
- name: Integration on Linux
if: 'tag IS NOT present AND type != pull_request AND (branch IN (master, staging, trying) OR branch =~ /^rc\// OR (branch = develop AND commit_message !~ /^Merge #\d+/))'
os: linux
script: make integration
- name: Code Coverage
if: 'tag IS NOT present AND ((branch = master AND type != pull_request) OR head_branch =~ /^rc\//)'
os: linux
env: CACHE_NAME=tarpaulin
install:
- cargo tarpaulin --version || travis_retry cargo install cargo-tarpaulin
script:
# allow failures
- if make cov; then bash <(curl -s https://codecov.io/bash); fi
- name: Package for macOS
if: 'tag IS present AND env(GITHUB_TOKEN) IS present'
os: osx
env: REL_PKG=x86_64-apple-darwin.zip
script:
- make prod
- openssl aes-256-cbc -K $encrypted_82dff4145bbf_key -iv $encrypted_82dff4145bbf_iv -in devtools/ci/travis-secret.asc.enc -out devtools/ci/travis-secret.asc -d
- gpg --import devtools/ci/travis-secret.asc
- devtools/ci/package.sh target/release/ckb
- name: Package for Linux
if: 'tag IS present AND env(GITHUB_TOKEN) IS present'
language: ruby
addons: { apt: { packages: [] } }
env: REL_PKG=x86_64-unknown-linux-gnu.tar.gz BUILDER_IMAGE=nervos/ckb-docker-builder:xenial-rust-1.36.0
script:
- mkdir -p $HOME/.cargo
- docker run --rm -it -w /ckb -v $(pwd):/ckb -v $HOME/.cargo:/root/.cargo -e OPENSSL_STATIC=1 -e OPENSSL_LIB_DIR=/usr/local/lib -e OPENSSL_INCLUDE_DIR=/usr/local/include/openssl $BUILDER_IMAGE make prod
- openssl aes-256-cbc -K $encrypted_82dff4145bbf_key -iv $encrypted_82dff4145bbf_iv -in devtools/ci/travis-secret.asc.enc -out devtools/ci/travis-secret.asc -d
- gpg --import devtools/ci/travis-secret.asc
- devtools/ci/package.sh target/release/ckb
- name: Package for Centos
if: 'tag IS present AND env(GITHUB_TOKEN) IS present'
language: ruby
addons: { apt: { packages: [] } }
env: REL_PKG=x86_64-unknown-centos-gnu.tar.gz BUILDER_IMAGE=nervos/ckb-docker-builder:centos-7-rust-1.36.0
script:
- mkdir -p $HOME/.cargo
- docker run --rm -it -w /ckb -v $(pwd):/ckb -v $HOME/.cargo:/root/.cargo $BUILDER_IMAGE scl enable llvm-toolset-7 'make prod'
- openssl aes-256-cbc -K $encrypted_82dff4145bbf_key -iv $encrypted_82dff4145bbf_iv -in devtools/ci/travis-secret.asc.enc -out devtools/ci/travis-secret.asc -d
- gpg --import devtools/ci/travis-secret.asc
- devtools/ci/package.sh target/release/ckb