forked from nervosnetwork/ckb-cli
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path.travis.yml
130 lines (120 loc) · 4.48 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
language: rust
rust: 1.38.0
dist: xenial
sudo: true
cache:
cargo: true
timeout: 1024
git:
depth: 2
submodules: false
env:
global:
- RUST_BACKTRACE=full
addons:
apt:
packages:
- libssl-dev
- autoconf
- flex
- bison
- texinfo
- libtool
before_install:
- cargo sweep --version || travis_retry cargo install --git https://github.com/holmgr/cargo-sweep --rev 4770deda37a2203c783e301b8c0c895964e8971e
- cargo sweep -s
before_script:
- if [ "$TRAVIS_OS_NAME" = "osx" ]; then ulimit -n 8192; fi
script: make test
before_cache:
- rm -rf ./target/release/incremental/
- rm -rf ./target/debug/incremental/
- cargo sweep -f
deploy:
provider: releases
api_key: "$GITHUB_TOKEN"
file:
- "releases/ckb-cli_${TRAVIS_TAG}_${REL_PKG}"
- "releases/ckb-cli_${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 = master)'
os: osx
- name: Tests on Linux
if: 'tag IS NOT present AND (type = pull_request OR branch = master)'
os: linux
- name: Linters
env: CACHE_NAME=linters
if: 'tag IS NOT present AND (type = pull_request OR branch = master)'
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: Security Audit
if: 'tag IS NOT present AND (type = pull_request OR branch = master)'
os: linux
rust: nightly
script: make security-audit
- name: PR Integration
if: 'tag IS NOT present AND (type = pull_request OR branch = master)'
os: linux
script: make integration
- name: Package for macOS
if: 'tag IS present AND env(GITHUB_TOKEN) IS present'
os: osx
env: REL_PKG=x86_64-apple-darwin.zip
before_install: skip
cache:
directories:
- $HOME/.cargo
before_cache:
- rm -rf $HOME/.cargo/registry
script:
- make OPENSSL_STATIC=1 OPENSSL_LIB_DIR=/usr/local/opt/[email protected]/lib OPENSSL_INCLUDE_DIR=/usr/local/opt/[email protected]/include prod
- openssl aes-256-cbc -K $encrypted_2e21ee7c4b13_key -iv $encrypted_2e21ee7c4b13_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-cli
- 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.38.0
before_install: skip
before_cache: skip
cache:
directories:
- $HOME/.cargo/git
script:
- mkdir -p $HOME/.cargo/git
- docker run --rm -it -w /ckb-cli -v $(pwd):/ckb-cli -v $HOME/.cargo/git:/root/.cargo/git -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_2e21ee7c4b13_key -iv $encrypted_2e21ee7c4b13_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-cli
- 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.38.0
before_install: skip
before_cache: skip
cache:
directories:
- $HOME/.cargo/git
script:
- mkdir -p $HOME/.cargo/git
- docker run --rm -it -w /ckb-cli -v $(pwd):/ckb-cli -v $HOME/.cargo/git:/root/.cargo/git $BUILDER_IMAGE scl enable llvm-toolset-7 'make prod'
- openssl aes-256-cbc -K $encrypted_2e21ee7c4b13_key -iv $encrypted_2e21ee7c4b13_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-cli