File tree Expand file tree Collapse file tree 2 files changed +19
-7
lines changed Expand file tree Collapse file tree 2 files changed +19
-7
lines changed Original file line number Diff line number Diff line change 9
9
# Specify the execution environment. You can specify an image from Dockerhub or use one of our Convenience Images from CircleCI's Developer Hub.
10
10
# See: https://circleci.com/docs/2.0/configuration-reference/#docker-machine-macos-windows-executor
11
11
docker :
12
- - image : cimg/rust:1.58.1
12
+ - image : cimg/rust:1.62.0
13
13
environment :
14
14
RUST_LOG : info
15
+ RUSTFLAGS : " -C instrument-coverage"
16
+ LLVM_PROFILE_FILE : " pgcat-%m.profraw"
15
17
- image : postgres:14
16
18
# auth:
17
19
# username: mydockerhub-user
@@ -32,16 +34,19 @@ jobs:
32
34
command : " cargo fmt --check"
33
35
- run :
34
36
name : " Install dependencies"
35
- command : " sudo apt-get update && sudo apt-get install -y psmisc postgresql-contrib-12 postgresql-client-12 ruby ruby-dev libpq-dev python3 python3-pip"
37
+ command : " sudo apt-get update && sudo apt-get install -y psmisc postgresql-contrib-12 postgresql-client-12 ruby ruby-dev libpq-dev python3 python3-pip lcov llvm-11"
38
+ - run :
39
+ name : " Install rust tools"
40
+ command : " cargo install cargo-binutils rustfilt && rustup component add llvm-tools-preview"
36
41
- run :
37
42
name : " Build"
38
43
command : " cargo build"
39
44
- run :
40
- name : " Test "
41
- command : " cargo test"
42
- - run :
43
- name : " Test end-to-end "
44
- command : " bash .circleci/run_tests.sh "
45
+ name : " Tests "
46
+ command : " cargo test && bash .circleci/run_tests.sh && .circleci/generate_coverage.sh "
47
+ - store_artifacts :
48
+ path : /tmp/cov
49
+ destination : coverage-data
45
50
- save_cache :
46
51
key : cargo-lock-2-{{ checksum "Cargo.lock" }}
47
52
paths :
Original file line number Diff line number Diff line change
1
+ #! /bin/bash
2
+
3
+ rust-profdata merge -sparse pgcat-* .profraw -o pgcat.profdata
4
+
5
+ rust-cov export -ignore-filename-regex=" rustc|registry" -Xdemangler=rustfilt -instr-profile=pgcat.profdata --object ./target/debug/pgcat --format lcov > ./lcov.info
6
+
7
+ genhtml lcov.info --output-directory /tmp/cov --prefix $( pwd)
You can’t perform that action at this time.
0 commit comments