File tree Expand file tree Collapse file tree 4 files changed +15
-2
lines changed Expand file tree Collapse file tree 4 files changed +15
-2
lines changed Original file line number Diff line number Diff line change @@ -41,10 +41,11 @@ jobs:
41
41
Optional parameters for ` mt-mods/mineunit-actions`:
42
42
43
43
* **`working-directory`** Working directory for unit tests, can be used when testing modpacks or multiple mods.
44
+ * **`mineunit-args`** Mineunit extra arguments, for example to specify `--engine-version 5.7.0`.
45
+ * **`coverage`** Luacov code coverage. Enabled by default.
44
46
* **`badge-name`** Code coverage badge name.
45
47
* **`badge-label`** Code coverage badge label.
46
48
* **`badge-color`** Code coverage badge color.
47
- * **`mineunit-args`** Mineunit extra arguments, for example to specify `--engine-version 5.7.0`.
48
49
* **`mineunit-version`** Mineunit version.
49
50
50
51
Outputs :
Original file line number Diff line number Diff line change @@ -13,6 +13,10 @@ inputs:
13
13
mineunit-args :
14
14
description : " Additional arguments for mineunit"
15
15
required : false
16
+ coverage :
17
+ description : " Enable code coverage"
18
+ required : true
19
+ default : true
16
20
badge-name :
17
21
description : " Code coverage badge name"
18
22
required : true
Original file line number Diff line number Diff line change 11
11
12
12
if (( $ERR != 0 )) ; then
13
13
exit $ERR
14
+ elif [[ " $INPUT_COVERAGE " != " true" ]]; then
15
+ exit 0
14
16
fi
15
17
16
18
echo " Generating report in $( pwd) "
Original file line number Diff line number Diff line change 1
1
#! /bin/bash
2
2
set +eo pipefail
3
3
4
+ # Configure (todo: kind of backwards currently)
5
+ BUILTIN_ARGS=(-c)
6
+ if [[ " $INPUT_COVERAGE " != " true" ]]; then
7
+ BUILTIN_ARGS=()
8
+ fi
9
+
4
10
# Run tests, collect output and save return code
5
11
exec 3>&1
6
- OUT=" $( mineunit -c ${INPUT_MINEUNIT_ARGS} | tee >( cat - >&3 ) ; exit ${PIPESTATUS[0]} ) "
12
+ OUT=" $( mineunit " ${BUILTIN_ARGS[@]} " ${INPUT_MINEUNIT_ARGS} | tee >( cat - >&3 ) ; exit ${PIPESTATUS[0]} ) "
7
13
ERR=$?
8
14
exec 3>& -
9
15
You can’t perform that action at this time.
0 commit comments