forked from driftluo/cita-cli
-
Notifications
You must be signed in to change notification settings - Fork 23
/
.travis.yml
69 lines (66 loc) · 1.71 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
################
# CI Workflow:
# stages:
# 1. test for cita-cli
# 2. build bin
# build bin for linux
# build bin for mac
# deploy: release bin to Github Release, trigger by `git push --tags`
# after_deploy: build cita-cli image and push to https://hub.docker.com/
################
language: rust
rust:
- stable
sudo: required
cache:
timeout: 1024
directories:
- "$TRAVIS_BUILD_DIR"
- "$TRAVIS_BUILD_DIR/docker/release"
stages:
- auto-test-in-ci
- build-bin-for-linux-deploy
- build-bin-for-mac-deploy
jobs:
include:
- stage: automatic-test-in-ci
os:
- linux
dist: bionic
name: automatic test for cita-cli
before_script:
- rustup component add rustfmt-preview
- rustup component add clippy
script:
# For speed up the CI process
# See: https://docs.travis-ci.com/user/build-stages/#Data-persistence-between-stages-and-jobs
- .ci-script/clippy_test.sh
- cargo fmt -- --check && cargo test --all
- cd cita-cli && cargo test --no-default-features --features openssl
- stage: build-bin-for-linux-deploy
os:
- linux
dist: bionic
name: buid bin for linux deploy
if: tag IS present
script:
- "./.ci-script/build-bin-for-linux-deploy.sh"
- stage: build-bin-for-mac-deploy
os:
- osx
name: buid bin for mac deploy
if: tag IS present
script:
- "./.ci-script/build-bin-for-mac-deploy.sh"
deploy:
provider: releases
skip_cleanup: true
api_key:
secure: $GITHUB_TOKEN
file:
- "./docker/release/cita-cli-x86_64-musl-tls-${TRAVIS_TAG}.tar.gz"
- "./docker/release/cita-cli-x86_64-mac-osx-tls-${TRAVIS_TAG}.tar.gz"
on:
tags: true
after_deploy:
- "./.ci-script/build-push-docker-image.sh"