Skip to content

Commit bdae958

Browse files
authored
Merge pull request #2 from per1234/runtimes-list
Add support for multiple test runtimes
2 parents 4ef2948 + 540f4d5 commit bdae958

File tree

2 files changed

+29
-14
lines changed

2 files changed

+29
-14
lines changed

README.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,11 @@ The top-level directory for build output.
2323

2424
**Default**: `extras/test/build`
2525

26-
### `runtime-path`
26+
### `runtime-paths`
2727

28-
Path of the runtime binary generated by building the tests.
28+
YAML format list of paths to runtime binaries generated by building the tests.
2929

30-
**Default**: `extras/test/build/bin/unit-test-binary`
30+
**Default**: `"- extras/test/build/bin/unit-test-binary"`
3131

3232
### `coverage-exclude-paths`
3333

action.yml

+26-11
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@ inputs:
1010
description: Path of the top-level folder for build output.
1111
required: true
1212
default: ${{ github.workspace }}/extras/test/build
13-
runtime-path:
14-
description: Path of the runtime binary generated by building the tests.
13+
runtime-paths:
14+
description: YAML format list of paths to runtime binaries generated by building the tests.
1515
required: true
16-
default: ${{ github.workspace }}/extras/test/build/bin/unit-test-binary
16+
default: "- ${{ github.workspace }}/extras/test/build/bin/unit-test-binary"
1717
coverage-exclude-paths:
1818
description: YAML format list of paths to remove from coverage data.
1919
required: true
@@ -28,7 +28,7 @@ inputs:
2828

2929
runs:
3030
using: composite
31-
steps:
31+
steps:
3232
- name: Build tests
3333
shell: bash
3434
run: |
@@ -39,6 +39,11 @@ runs:
3939
make --directory="${{ inputs.build-path }}"
4040
echo "::endgroup::"
4141
42+
- name: Install yq
43+
shell: bash
44+
run: |
45+
sudo snap install yq > /dev/null
46+
4247
- name: Install Valgrind
4348
shell: bash
4449
run: |
@@ -47,14 +52,24 @@ runs:
4752
- name: Run tests
4853
shell: bash
4954
run: |
50-
echo "::group::Run ${{ inputs.runtime-path }} with Valgrind"
51-
valgrind --tool=memcheck --leak-check=yes --error-exitcode=1 "${{ inputs.runtime-path }}"
52-
echo "::endgroup::"
55+
if [[ -n "${{ inputs.runtime-path }}" ]]; then
56+
echo "::warning::The runtime-path input is deprecated. Please use runtime-paths instead."
57+
RUNTIME_PATHS="${{ inputs.runtime-path }}"
58+
else
59+
RUNTIME_PATHS="${{ inputs.runtime-paths }}"
60+
fi
5361
54-
- name: Install yq
55-
shell: bash
56-
run: |
57-
sudo snap install yq > /dev/null
62+
EXIT_STATUS=0
63+
set +o errexit
64+
while IFS='' read -r runtimePath && [[ -n "$runtimePath" ]]; do
65+
echo "::group::Run $runtimePath with Valgrind"
66+
if ! valgrind --tool=memcheck --leak-check=yes --error-exitcode=1 "$runtimePath"; then
67+
EXIT_STATUS=1
68+
echo "::error file=$runtimePath::While running $runtimePath"
69+
fi
70+
echo "::endgroup::"
71+
done <<<"$(echo "$RUNTIME_PATHS" | yq read - [*])"
72+
exit $EXIT_STATUS
5873
5974
- name: Parse coverage-exclude-paths input
6075
id: parse-coverage-exclude-paths

0 commit comments

Comments
 (0)