-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcircle.yml
48 lines (48 loc) · 1.75 KB
/
circle.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
machine:
services:
- docker
environment:
PATH: $PATH:/home/ubuntu/.cargo/bin
dependencies:
cache_directories:
- "/home/ubuntu/.cargo"
- "/home/ubuntu/cache"
override:
# It's necessary to delete this file, because it rewrites a bunch
# of URLs that Cargo tries to access, and messes everything up.
- rm ~/.gitconfig
- mkdir -p ~/cache
- mkdir /tmp/largetable
- sudo apt-get install libncursesw5-dev
- circleci/install_protobuf.sh
- circleci/install_rust.sh
- circleci/install_kcov.sh
- circleci/install_binutils.sh
# This install will fail if we have a valid cache, but that's okay.
- cargo install protobuf || true
- protoc --rust_out src/generated src/protobuf/dtable.proto
- protoc --rust_out src/generated src/protobuf/query.proto
# Now we'll build the docker image.
- cargo build --release --target=x86_64-unknown-linux-musl --bin largetable
- docker build --rm=false -t colinmerkel/largetable:$CIRCLE_SHA1 .
test:
override:
# Run the docker container, which is used in the integration tests.
- docker run -d -p 8080:8080 colinmerkel/largetable:$CIRCLE_SHA1
# Run rust's internal unit tests for each component.
- ~/.cargo/bin/cargo test
# Run a test of the CLI and docker container running together.
- ~/.cargo/bin/cargo build --bin largetable-cli
- circleci/test_cli.sh
post:
# Upload code coverage statement to codecov.io
- rm ./target/debug/largetable*.d || true
- rm ./target/debug/largetable
- ./circleci/generate_coverage.sh
deployment:
hub:
branch: master
commands:
# Save the image to docker hub.
- docker login -e $DOCKER_EMAIL -u $DOCKER_USER -p $DOCKER_PASS
- docker push colinmerkel/largetable:$CIRCLE_SHA1