This repository was archived by the owner on Feb 17, 2024. It is now read-only.
File tree 3 files changed +39
-10
lines changed
3 files changed +39
-10
lines changed Original file line number Diff line number Diff line change @@ -28,7 +28,6 @@ name: CI
28
28
on : [ push, pull_request ]
29
29
jobs :
30
30
test-coverage :
31
- name : cargo test with coveralls
32
31
runs-on : ubuntu-latest
33
32
steps :
34
33
- uses : actions/checkout@v2
43
42
### Inputs
44
43
45
44
- ` dependencies_debian`: Debian packages to install before running the tests.
45
+ - `output_type` : output type to pass to grcov.
46
+ - `output_path` : output path to pass to grcov.
47
+
48
+
49
+ If neither `output_type` and `output_path` are defined, the action by
50
+ default creates an lcov.info file in the current directory.
46
51
47
52
# # Alternatives
48
53
Original file line number Diff line number Diff line change @@ -6,8 +6,17 @@ branding:
6
6
color : black
7
7
inputs :
8
8
dependencies_debian :
9
- description : ' Dependencies as Debian packages to install; used if defined'
9
+ description : Dependencies as Debian packages to install; used if defined
10
10
default : ' '
11
+ output_type :
12
+ description : Output type to pass to grcov
13
+ default : ' '
14
+ output_path :
15
+ description : Output path to pass to grcov and set as report variable
16
+ default : ' '
17
+ outputs :
18
+ report :
19
+ description : Name of report file, for compatibility with rust-grcov
11
20
runs :
12
21
using : ' docker'
13
22
image : ' Dockerfile'
Original file line number Diff line number Diff line change 13
13
}
14
14
fi
15
15
16
- OUTPUT_PATH=lcov.info
16
+ GRCOV=( grcov . \
17
+ -s . \
18
+ --binary-path ./target/debug/ \
19
+ --ignore " /*" --ignore " ../*" \
20
+ --branch --ignore-not-existing \
21
+ )
22
+
23
+ if [ -n " $INPUT_OUTPUT_TYPE " ]; then
24
+ GRCOV+=( -t " $INPUT_OUTPUT_TYPE " )
25
+ fi
26
+
27
+ if [ -n " $INPUT_OUTPUT_PATH " ]; then
28
+ GRCOV+=( -o " $INPUT_OUTPUT_PATH " )
29
+ OUTPUT_PATH=" $INPUT_OUTPUT_PATH "
30
+ elif [ -z " $INPUT_OUTPUT_TYPE " ]; then
31
+ # Default if no output_type was specified either
32
+ GRCOV+=( -o lcov.info )
33
+ OUTPUT_PATH=" lcov.info"
34
+ fi
17
35
18
36
set -e -x
19
37
@@ -27,11 +45,8 @@ export RUST_BACKTRACE=1
27
45
28
46
cargo test --all-features --no-fail-fast
29
47
30
- grcov . \
31
- -s . \
32
- --binary-path ./target/debug/ \
33
- --ignore " /*" --ignore " ../*" \
34
- --branch --ignore-not-existing \
35
- -o " $OUTPUT_PATH "
36
- echo " ::set-output name=report::$OUTPUT_PATH "
48
+ " ${GRCOV[@]} "
49
+ if [ -n " $OUTPUT_PATH " ]; then
50
+ echo " ::set-output name=report::$OUTPUT_PATH "
51
+ fi
37
52
You can’t perform that action at this time.
0 commit comments